X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/3f24ff6b4246a5206555952f6e6c53f6ed5231d8..refs/heads/xml2:/librarian/__init__.py?ds=inline diff --git a/librarian/__init__.py b/librarian/__init__.py index a0d70e7..ec1d688 100644 --- a/librarian/__init__.py +++ b/librarian/__init__.py @@ -8,6 +8,22 @@ import urllib from .utils import XMLNamespace +VIDEO_PROVIDERS = { + 'youtube': { + 'url': 'https://www.youtube.com/watch?v=%s', + 'embed': '//www.youtube.com/embed/%s?controls=2&rel=0&showinfo=0&theme=light', + }, + 'vimeo': { + 'url': 'https://vimeo.com/%s', + 'embed': '//player.vimeo.com/video/%s', + }, +} + + +def get_provider(provider_id): + return VIDEO_PROVIDERS.get(provider_id, VIDEO_PROVIDERS['youtube']) + + class UnicodeException(Exception): def __str__(self): """ Dirty workaround for Python Unicode handling problems. """