fnp
/
librarian.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add vimeo
[librarian.git]
/
librarian
/
formats
/
epub
/
__init__.py
diff --git
a/librarian/formats/epub/__init__.py
b/librarian/formats/epub/__init__.py
index
36891be
..
4e2e6e5
100644
(file)
--- a/
librarian/formats/epub/__init__.py
+++ b/
librarian/formats/epub/__init__.py
@@
-13,7
+13,7
@@
import zipfile
from urllib2 import urlopen
from lxml import etree
from urllib2 import urlopen
from lxml import etree
-from librarian import OPFNS, NCXNS, XHTMLNS, DCNS, BuildError
+from librarian import OPFNS, NCXNS, XHTMLNS, DCNS, BuildError
, VIDEO_PROVIDERS
from librarian import core
from librarian.formats import Format
from librarian.formats.cover.evens import EvensCover
from librarian import core
from librarian.formats import Format
from librarian.formats.cover.evens import EvensCover
@@
-360,7
+360,7
@@
EpubFormat.renderers.register(core.Div, 'img', DivImageR('img'))
class DivVideoR(Silent):
def render(self, element, ctx):
class DivVideoR(Silent):
def render(self, element, ctx):
- src =
'https://www.youtube.com/watch?v=%s'
% element.attrib.get('videoid', '')
+ src =
VIDEO_PROVIDERS[element.attrib.get('provider')]['url']
% element.attrib.get('videoid', '')
return super(DivVideoR, self).render(element, Context(ctx, src=src))
def container(self, ctx):
return super(DivVideoR, self).render(element, Context(ctx, src=src))
def container(self, ctx):