Merge branch 'Twitch' into 'master'
add Twitch mime parser See merge request ajak/tuir!1
This commit is contained in:
@@ -320,6 +320,16 @@ class StreamableMIMEParser(OpenGraphMIMEParser):
|
|||||||
"""
|
"""
|
||||||
pattern = re.compile(r'https?://(www\.)?streamable\.com/[^.]+$')
|
pattern = re.compile(r'https?://(www\.)?streamable\.com/[^.]+$')
|
||||||
|
|
||||||
|
class TwitchMIMEParser(BaseMIMEParser):
|
||||||
|
"""
|
||||||
|
Twitch 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?://(clips|go|m|player|www)\.?twitch\.tv/[^.]+$')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_mimetype(url):
|
||||||
|
return url, 'video/x-youtube'
|
||||||
|
|
||||||
class LiveleakMIMEParser(BaseMIMEParser):
|
class LiveleakMIMEParser(BaseMIMEParser):
|
||||||
"""
|
"""
|
||||||
@@ -479,6 +489,7 @@ parsers = [
|
|||||||
GiphyMIMEParser,
|
GiphyMIMEParser,
|
||||||
ImgflipMIMEParser,
|
ImgflipMIMEParser,
|
||||||
LivememeMIMEParser,
|
LivememeMIMEParser,
|
||||||
|
TwitchMIMEParser,
|
||||||
MakeamemeMIMEParser,
|
MakeamemeMIMEParser,
|
||||||
WorldStarHipHopMIMEParser,
|
WorldStarHipHopMIMEParser,
|
||||||
GifvMIMEParser,
|
GifvMIMEParser,
|
||||||
|
|||||||
Reference in New Issue
Block a user