mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-29 12:41:27 +00:00
[youtube:playlist] Raise an error if the list doesn't exist or is private (closes #2840)
This commit is contained in:
parent
669f0e7cda
commit
10c0e2d818
1 changed files with 7 additions and 0 deletions
|
@ -1436,6 +1436,13 @@ def _real_extract(self, url):
|
||||||
page = self._download_webpage(url, playlist_id)
|
page = self._download_webpage(url, playlist_id)
|
||||||
more_widget_html = content_html = page
|
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
|
# Extract the video ids from the playlist pages
|
||||||
ids = []
|
ids = []
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue