Add mime parser: vimeo.com
This commit is contained in:
@@ -103,6 +103,18 @@ class YoutubeMIMEParser(BaseMIMEParser):
|
|||||||
return url, 'video/x-youtube'
|
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):
|
class GifvMIMEParser(BaseMIMEParser):
|
||||||
"""
|
"""
|
||||||
Special case for .gifv, which is a custom video format for imgur serves
|
Special case for .gifv, which is a custom video format for imgur serves
|
||||||
@@ -502,6 +514,7 @@ parsers = [
|
|||||||
RedditUploadsMIMEParser,
|
RedditUploadsMIMEParser,
|
||||||
RedditVideoMIMEParser,
|
RedditVideoMIMEParser,
|
||||||
YoutubeMIMEParser,
|
YoutubeMIMEParser,
|
||||||
|
VimeoMIMEParser,
|
||||||
LiveleakMIMEParser,
|
LiveleakMIMEParser,
|
||||||
TwitchMIMEParser,
|
TwitchMIMEParser,
|
||||||
FlickrMIMEParser,
|
FlickrMIMEParser,
|
||||||
|
|||||||
@@ -134,6 +134,10 @@ URLS = OrderedDict([
|
|||||||
'http://www.worldstarhiphop.com/videos/video.php?v=wshhJ6bVdAv0iMrNGFZG',
|
'http://www.worldstarhiphop.com/videos/video.php?v=wshhJ6bVdAv0iMrNGFZG',
|
||||||
'http://www.youtube.com/embed/Bze53qwHS8o?autoplay=1',
|
'http://www.youtube.com/embed/Bze53qwHS8o?autoplay=1',
|
||||||
'video/x-youtube')),
|
'video/x-youtube')),
|
||||||
|
('vimeo', (
|
||||||
|
'https://vimeo.com/247872788',
|
||||||
|
'https://vimeo.com/247872788',
|
||||||
|
'video/x-youtube')),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user