Skip to content

Commit

Permalink
Merge pull request ytdl-org#8 from geauxlo/master
Browse files Browse the repository at this point in the history
[twitch]
  • Loading branch information
blackjack4494 authored Aug 31, 2020
2 parents ffc632a + 33afd66 commit 70ef7d5
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions youtube_dl/extractor/twitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 70ef7d5

Please sign in to comment.