X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/ea9a4eea8ee61954c9ae52e8662139c8933ea95d..8722e4d3cfe77bd6945b8617b484fb9db6c4c9ca:/librarian/formats/html/__init__.py diff --git a/librarian/formats/html/__init__.py b/librarian/formats/html/__init__.py index 064eba7..271fac9 100644 --- a/librarian/formats/html/__init__.py +++ b/librarian/formats/html/__init__.py @@ -9,7 +9,7 @@ from librarian.formats import Format from librarian.output import OutputFile from librarian.renderers import Register, TreeRenderer from librarian.utils import Context, get_resource -from librarian import core, VIDEO_PROVIDERS +from librarian import core, get_provider class HtmlFormat(Format): @@ -191,12 +191,12 @@ HtmlFormat.renderers.register(core.Div, 'img', DivImage('img')) class DivVideo(NaturalText): def render(self, element, ctx): output = super(DivVideo, self).render(element, ctx) - provider = element.attrib.get('provider', '') + provider = get_provider(element.attrib.get('provider')) video_id = element.attrib.get('videoid', '') attribs = { 'width': '854', 'height': '480', - 'src': VIDEO_PROVIDERS[provider]['embed'] % video_id, + 'src': provider['embed'] % video_id, 'frameborder': '0', 'allowfullscreen': '', }