fix video
[librarian.git] / librarian / __init__.py
index 02464ef..ec1d688 100644 (file)
@@ -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