Bläddra i källkod

[youtube:playlist] Fix nonexistent/private playlist detection (closes #11604)

Grzegorz P 8 år sedan
förälder
incheckning
8bc0800d7c
1 ändrade filer med 2 tillägg och 1 borttagningar
  1. 2 1
      youtube_dl/extractor/youtube.py

+ 2 - 1
youtube_dl/extractor/youtube.py

@@ -1998,7 +1998,8 @@ class YoutubePlaylistIE(YoutubePlaylistBaseInfoExtractor):
         url = self._TEMPLATE_URL % playlist_id
         url = self._TEMPLATE_URL % playlist_id
         page = self._download_webpage(url, playlist_id)
         page = self._download_webpage(url, playlist_id)
 
 
-        for match in re.findall(r'<div class="yt-alert-message">([^<]+)</div>', page):
+        # the yt-alert-message now has tabindex attribute (see https://github.com/rg3/youtube-dl/issues/11604)
+        for match in re.findall(r'<div class="yt-alert-message"[^>]*>([^<]+)</div>', page):
             match = match.strip()
             match = match.strip()
             # Check if the playlist exists or is private
             # Check if the playlist exists or is private
             if re.match(r'[^<]*(The|This) playlist (does not exist|is private)[^<]*', match):
             if re.match(r'[^<]*(The|This) playlist (does not exist|is private)[^<]*', match):