Skip to content

Commit

Permalink
[youtube] Prevent excess HTTP 301 (#25786)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-slayden authored Jun 30, 2020
1 parent e942cfd commit 07af16b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions youtube_dl/extractor/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def _entries(self, page, playlist_id):
# Downloading page may result in intermittent 5xx HTTP error
# that is usually worked around with a retry
more = self._download_json(
'https://youtube.com/%s' % mobj.group('more'), playlist_id,
'https://www.youtube.com/%s' % mobj.group('more'), playlist_id,
'Downloading page #%s%s'
% (page_num, ' (retry #%d)' % count if count else ''),
transform_source=uppercase_escape,
Expand Down Expand Up @@ -2776,7 +2776,7 @@ def _extract_mix(self, playlist_id):
ids = []
last_id = playlist_id[-11:]
for n in itertools.count(1):
url = 'https://youtube.com/watch?v=%s&list=%s' % (last_id, playlist_id)
url = 'https://www.youtube.com/watch?v=%s&list=%s' % (last_id, playlist_id)
webpage = self._download_webpage(
url, playlist_id, 'Downloading page {0} of Youtube mix'.format(n))
new_ids = orderedSet(re.findall(
Expand Down Expand Up @@ -3289,7 +3289,7 @@ def _entries(self, page):
break

more = self._download_json(
'https://youtube.com/%s' % mobj.group('more'), self._PLAYLIST_TITLE,
'https://www.youtube.com/%s' % mobj.group('more'), self._PLAYLIST_TITLE,
'Downloading page #%s' % page_num,
transform_source=uppercase_escape,
headers=self._YOUTUBE_CLIENT_HEADERS)
Expand Down

0 comments on commit 07af16b

Please sign in to comment.