aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-05-30 18:29:16 +0600
committerSergey M․ <dstftw@gmail.com>2015-05-30 18:29:16 +0600
commit386bdfa698a7f06c43df91913677db3732e29900 (patch)
treebfdec44309eda883234ba7879c644d00b088158b /youtube_dl
parent1ae7ff771b17d16540aa446aef4f10971465a249 (diff)
downloadyoutube-dl-386bdfa698a7f06c43df91913677db3732e29900.tar.xz
[youtube:user] Workaround 35 pages limitation (Closes #5778)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/youtube.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index 0301682b8..fcdbfe0bc 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -1399,6 +1399,26 @@ class YoutubeChannelIE(InfoExtractor):
channel_id = self._match_id(url)
url = self._TEMPLATE_URL % channel_id
+
+ # Channel by page listing is restricted to 35 pages of 30 items, i.e. 1050 videos total (see #5778)
+ # Workaround by extracting as a playlist if managed to obtain channel playlist URL
+ # otherwise fallback on channel by page extraction
+ channel_page = self._download_webpage(
+ url + '?view=57', channel_id,
+ 'Downloading channel page', fatal=False)
+ channel_playlist_id = self._search_regex(
+ [r'<meta itemprop="channelId" content="([^"]+)">',
+ r'data-channel-external-id="([^"]+)"'],
+ channel_page, 'channel id', default=None)
+ if channel_playlist_id and channel_playlist_id.startswith('UC'):
+ playlist_id = 'UU' + channel_playlist_id[2:]
+ channel_playlist = unescapeHTML(self._search_regex(
+ r'href="/?(watch\?v=[0-9A-Za-z_-]{11}&amp;list=%s)"' % playlist_id,
+ channel_page, 'channel playlist URL', default=None))
+ if channel_playlist:
+ return self.url_result(
+ compat_urlparse.urljoin(url, '/%s' % channel_playlist), 'YoutubePlaylist')
+
channel_page = self._download_webpage(url, channel_id, 'Downloading page #1')
autogenerated = re.search(r'''(?x)
class="[^"]*?(?: