X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/25af49b6c63e1c005129856e107143864ad5b245..refs/heads/xml2:/librarian/__init__.py diff --git a/librarian/__init__.py b/librarian/__init__.py index 02464ef..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. """ @@ -31,6 +47,11 @@ class ValidationError(UnicodeException): pass +# was deleted, but still used??? +class NoDublinCore(ValidationError): + pass + + class BuildError(Exception): pass