Merge pull request #565 from woorst/mime_parser_vimeo
Add mime parser: vimeo.com
This commit is contained in:
@@ -130,6 +130,18 @@ class YoutubeMIMEParser(BaseMIMEParser):
|
||||
return url, 'video/x-youtube'
|
||||
|
||||
|
||||
class VimeoMIMEParser(BaseMIMEParser):
|
||||
"""
|
||||
Vimeo videos can be streamed with vlc or downloaded with youtube-dl.
|
||||
Assign a custom mime-type so they can be referenced in mailcap.
|
||||
"""
|
||||
pattern = re.compile(r'https?://(www\.)?vimeo\.com/\d+$')
|
||||
|
||||
@staticmethod
|
||||
def get_mimetype(url):
|
||||
return url, 'video/x-youtube'
|
||||
|
||||
|
||||
class GifvMIMEParser(BaseMIMEParser):
|
||||
"""
|
||||
Special case for .gifv, which is a custom video format for imgur serves
|
||||
@@ -537,6 +549,7 @@ parsers = [
|
||||
RedditUploadsMIMEParser,
|
||||
RedditVideoMIMEParser,
|
||||
YoutubeMIMEParser,
|
||||
VimeoMIMEParser,
|
||||
LiveleakMIMEParser,
|
||||
TwitchMIMEParser,
|
||||
FlickrMIMEParser,
|
||||
|
||||
@@ -134,6 +134,10 @@ URLS = OrderedDict([
|
||||
'http://www.worldstarhiphop.com/videos/video.php?v=wshhJ6bVdAv0iMrNGFZG',
|
||||
'http://www.youtube.com/embed/Bze53qwHS8o?autoplay=1',
|
||||
'video/x-youtube')),
|
||||
('vimeo', (
|
||||
'https://vimeo.com/247872788',
|
||||
'https://vimeo.com/247872788',
|
||||
'video/x-youtube')),
|
||||
('streamja', (
|
||||
'https://streamja.com/6WMb',
|
||||
'https://cdnja.r.worldssl.net/mp4/6w/6WMb.mp4',
|
||||
|
||||
Reference in New Issue
Block a user