From 7838764d7bffd33d48f10c5a6267760be2d6fb7a Mon Sep 17 00:00:00 2001 From: Grzechooo Date: Sun, 8 Jan 2017 01:24:06 +0100 Subject: [PATCH 1/2] [youtube:playlist] Fix 'this playlist doesn't exist/is private' error not working (#11604) --- youtube_dl/extractor/youtube.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index 335568a10..75aa2207e 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -1955,7 +1955,8 @@ class YoutubePlaylistIE(YoutubePlaylistBaseInfoExtractor): url = self._TEMPLATE_URL % playlist_id page = self._download_webpage(url, playlist_id) - for match in re.findall(r'
([^<]+)
', page): + # the yt-alert-message now has tabindex attribute (see https://github.com/rg3/youtube-dl/issues/11604) + for match in re.findall(r'
]+?>([^<]+)
', page): match = match.strip() # Check if the playlist exists or is private if re.match(r'[^<]*(The|This) playlist (does not exist|is private)[^<]*', match): From deb325f272ebe790adb883dbbb28ff46a5b82430 Mon Sep 17 00:00:00 2001 From: Grzechooo Date: Sun, 22 Jan 2017 18:38:38 +0100 Subject: [PATCH 2/2] change '+?' to '*' in regex as per review --- youtube_dl/extractor/youtube.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index 75aa2207e..6f7b566f8 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -1956,7 +1956,7 @@ class YoutubePlaylistIE(YoutubePlaylistBaseInfoExtractor): page = self._download_webpage(url, playlist_id) # the yt-alert-message now has tabindex attribute (see https://github.com/rg3/youtube-dl/issues/11604) - for match in re.findall(r'
]+?>([^<]+)
', page): + for match in re.findall(r'
]*>([^<]+)
', page): match = match.strip() # Check if the playlist exists or is private if re.match(r'[^<]*(The|This) playlist (does not exist|is private)[^<]*', match):