diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2014-05-01 15:40:35 +0200 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2014-05-01 15:40:35 +0200 |
commit | 10c0e2d818830df0130a276b7d75a8c09705d892 (patch) | |
tree | e5096252215aea8d8873bdc16b469f3330f5b2ea /youtube_dl/extractor | |
parent | 669f0e7cdaaff51976f4963a845bc7722ea2152f (diff) |
[youtube:playlist] Raise an error if the list doesn't exist or is private (closes #2840)
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/youtube.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index c3ae33009..67845349e 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -1436,6 +1436,13 @@ class YoutubePlaylistIE(YoutubeBaseInfoExtractor): page = self._download_webpage(url, playlist_id) more_widget_html = content_html = page + # Check if the playlist exists or is private + if re.search(r'<div class="yt-alert-message">[^<]*?The playlist does not exist[^<]*?</div>', page) is not None: + raise ExtractorError( + u'The playlist doesn\'t exist or is private, use --username or ' + '--netrc to access it.', + expected=True) + # Extract the video ids from the playlist pages ids = [] |