projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[extractor/common] Add protocol for f4m formats
[youtube-dl]
/
youtube_dl
/
extractor
/
twitch.py
diff --git
a/youtube_dl/extractor/twitch.py
b/youtube_dl/extractor/twitch.py
index ed36336bd9eeacac649a17fb8acccc73e3029693..fefcd28078f6c69058366fbb7b8f9e616508fbb6 100644
(file)
--- a/
youtube_dl/extractor/twitch.py
+++ b/
youtube_dl/extractor/twitch.py
@@
-28,7
+28,7
@@
from ..utils import (
class TwitchBaseIE(InfoExtractor):
class TwitchBaseIE(InfoExtractor):
- _VALID_URL_BASE = r'https?://(?:
www
\.)?twitch\.tv'
+ _VALID_URL_BASE = r'https?://(?:
(?:www|go)
\.)?twitch\.tv'
_API_BASE = 'https://api.twitch.tv'
_USHER_BASE = 'https://usher.ttvnw.net'
_API_BASE = 'https://api.twitch.tv'
_USHER_BASE = 'https://usher.ttvnw.net'
@@
-104,7
+104,7
@@
class TwitchBaseIE(InfoExtractor):
login_page, handle, 'Logging in as %s' % username, {
'username': username,
'password': password,
login_page, handle, 'Logging in as %s' % username, {
'username': username,
'password': password,
- })
+
})
if re.search(r'(?i)<form[^>]+id="two-factor-submit"', redirect_page) is not None:
# TODO: Add mechanism to request an SMS or phone call
if re.search(r'(?i)<form[^>]+id="two-factor-submit"', redirect_page) is not None:
# TODO: Add mechanism to request an SMS or phone call
@@
-217,7
+217,7
@@
class TwitchVodIE(TwitchItemBaseIE):
_VALID_URL = r'''(?x)
https?://
(?:
_VALID_URL = r'''(?x)
https?://
(?:
- (?:
www
\.)?twitch\.tv/(?:[^/]+/v|videos)/|
+ (?:
(?:www|go)
\.)?twitch\.tv/(?:[^/]+/v|videos)/|
player\.twitch\.tv/\?.*?\bvideo=v
)
(?P<id>\d+)
player\.twitch\.tv/\?.*?\bvideo=v
)
(?P<id>\d+)
@@
-458,7
+458,7
@@
class TwitchStreamIE(TwitchBaseIE):
_VALID_URL = r'''(?x)
https?://
(?:
_VALID_URL = r'''(?x)
https?://
(?:
- (?:
www
\.)?twitch\.tv/|
+ (?:
(?:www|go)
\.)?twitch\.tv/|
player\.twitch\.tv/\?.*?\bchannel=
)
(?P<id>[^/#?]+)
player\.twitch\.tv/\?.*?\bchannel=
)
(?P<id>[^/#?]+)
@@
-489,6
+489,9
@@
class TwitchStreamIE(TwitchBaseIE):
}, {
'url': 'https://player.twitch.tv/?channel=lotsofs',
'only_matching': True,
}, {
'url': 'https://player.twitch.tv/?channel=lotsofs',
'only_matching': True,
+ }, {
+ 'url': 'https://go.twitch.tv/food',
+ 'only_matching': True,
}]
@classmethod
}]
@classmethod
@@
-606,7
+609,7
@@
class TwitchClipsIE(InfoExtractor):
r'(?s)clipInfo\s*=\s*({.+?});', webpage, 'clip info'),
video_id, transform_source=js_to_json)
r'(?s)clipInfo\s*=\s*({.+?});', webpage, 'clip info'),
video_id, transform_source=js_to_json)
- title = clip.get('channel_title') or self._og_search_title(webpage)
+ title = clip.get('
title') or clip.get('
channel_title') or self._og_search_title(webpage)
formats = [{
'url': option['source'],
formats = [{
'url': option['source'],