class embed_video.backends.SoundCloudBackend(url, is_secure=False)[source]

Backend for SoundCloud URLs.

class embed_video.backends.VideoBackend(url, is_secure=False)[source]

Base backend, good to inherit.

allow_https = True

Sets if HTTPS version allowed for specific backend.

get_embed_code(width, height)[source]

Returns embed code.


Returns thumbnail URL folded from pattern_thumbnail_url and parsed code.


Returns URL folded from pattern_url and parsed code.

classmethod is_valid(url)[source]

Class method to control if passed url is valid for current backend. By default it is done by re_detect regex.

pattern_thumbnail_url = None

Pattern in which the code is inserted to get thumbnail url.


pattern_url = None

Pattern in which the code is inserted.


re_code = None

Compiled regex (re.compile()) to search code in URL.

Example: re.compile(r'myvideo\.com/\?code=(?P<code>\w+)')

re_detect = None

Compilede regec (re.compile()) to detect, if input URL is valid for current backend.

Example: re.compile(r'^http://myvideo\.com/.*')

class embed_video.backends.VimeoBackend(url, is_secure=False)[source]

Backend for Vimeo URLs.

class embed_video.backends.YoutubeBackend(url, is_secure=False)[source]

Backend for YouTube URLs.


Detect the right backend for given URL.