Browse Source

[youtube:channel] Fix automated channel detection

master
Philipp Hagemeister 11 years ago
parent
commit
31812a9e0e
1 changed files with 5 additions and 4 deletions
  1. 9
      youtube_dl/extractor/youtube.py

9
youtube_dl/extractor/youtube.py

@ -1631,10 +1631,11 @@ class YoutubeChannelIE(InfoExtractor):
video_ids = [] video_ids = []
url = 'https://www.youtube.com/channel/%s/videos' % channel_id url = 'https://www.youtube.com/channel/%s/videos' % channel_id
channel_page = self._download_webpage(url, channel_id) channel_page = self._download_webpage(url, channel_id)
if re.search(r'channel-header-autogenerated-label', channel_page) is not None:
autogenerated = True
else:
autogenerated = False
autogenerated = re.search(r'''(?x)
class="[^"]*?(?:
channel-header-autogenerated-label|
yt-channel-title-autogenerated
)[^"]*"''', channel_page) is not None
if autogenerated: if autogenerated:
# The videos are contained in a single page # The videos are contained in a single page

Loading…
Cancel
Save