aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgeauxlo <66712139+geauxlo@users.noreply.github.com>2020-06-10 04:00:01 +0000
committerGitHub <noreply@github.com>2020-06-10 04:00:01 +0000
commitbf529967401dbac12e32ab852723a59e673dadab (patch)
tree0f74493a8b728f94df814c8e2539424a0677b13b
parent84213ea8d41d5fe1608333a16ac578dccdf9a915 (diff)
downloadhypervideo-pre-bf529967401dbac12e32ab852723a59e673dadab.tar.lz
hypervideo-pre-bf529967401dbac12e32ab852723a59e673dadab.tar.xz
hypervideo-pre-bf529967401dbac12e32ab852723a59e673dadab.zip
Update api call to v5 spec in TwitchPlaylistBaseIE
-rw-r--r--youtube_dl/extractor/twitch.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/youtube_dl/extractor/twitch.py b/youtube_dl/extractor/twitch.py
index e211cd4c8..3f0f7e277 100644
--- a/youtube_dl/extractor/twitch.py
+++ b/youtube_dl/extractor/twitch.py
@@ -380,11 +380,13 @@ class TwitchPlaylistBaseIE(TwitchBaseIE):
_PLAYLIST_PATH = 'kraken/channels/%s/videos/?offset=%d&limit=%d'
_PAGE_LIMIT = 100
- def _extract_playlist(self, channel_id):
+ def _extract_playlist(self, channel_name):
info = self._call_api(
- 'kraken/channels/%s' % channel_id,
- channel_id, 'Downloading channel info JSON')
- channel_name = info.get('display_name') or info.get('name')
+ 'kraken/users?login=%s' % channel_name,
+ channel_name, 'Downloading channel info JSON')
+ info = info['users'][0]
+ channel_id = info['_id']
+ channel_name = info.get('display_name') or info.get('name') or channel_name
entries = []
offset = 0
limit = self._PAGE_LIMIT
@@ -444,7 +446,7 @@ class TwitchProfileIE(TwitchPlaylistBaseIE):
_TESTS = [{
'url': 'http://www.twitch.tv/vanillatv/profile',
'info_dict': {
- 'id': 'vanillatv',
+ 'id': '22744919',
'title': 'VanillaTV',
},
'playlist_mincount': 412,
@@ -468,7 +470,7 @@ class TwitchAllVideosIE(TwitchVideosBaseIE):
_TESTS = [{
'url': 'https://www.twitch.tv/spamfish/videos/all',
'info_dict': {
- 'id': 'spamfish',
+ 'id': '497952',
'title': 'Spamfish',
},
'playlist_mincount': 869,
@@ -487,7 +489,7 @@ class TwitchUploadsIE(TwitchVideosBaseIE):
_TESTS = [{
'url': 'https://www.twitch.tv/spamfish/videos/uploads',
'info_dict': {
- 'id': 'spamfish',
+ 'id': '497952',
'title': 'Spamfish',
},
'playlist_mincount': 0,
@@ -506,7 +508,7 @@ class TwitchPastBroadcastsIE(TwitchVideosBaseIE):
_TESTS = [{
'url': 'https://www.twitch.tv/spamfish/videos/past-broadcasts',
'info_dict': {
- 'id': 'spamfish',
+ 'id': '497952',
'title': 'Spamfish',
},
'playlist_mincount': 0,
@@ -525,7 +527,7 @@ class TwitchHighlightsIE(TwitchVideosBaseIE):
_TESTS = [{
'url': 'https://www.twitch.tv/spamfish/videos/highlights',
'info_dict': {
- 'id': 'spamfish',
+ 'id': '497952',
'title': 'Spamfish',
},
'playlist_mincount': 805,