mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-22 08:34:32 +01:00
[youtube] Fix youtube mix playlist extraction (closes #26390)
This commit is contained in:
parent
d51e23d9fc
commit
483056d624
@ -45,8 +45,8 @@ class TestYoutubeLists(unittest.TestCase):
|
||||
result = ie.extract('https://www.youtube.com/watch?v=W01L70IGBgE&index=2&list=RDOQpdSVF_k_w')
|
||||
entries = result['entries']
|
||||
self.assertTrue(len(entries) >= 50)
|
||||
original_video = entries[0]
|
||||
self.assertEqual(original_video['id'], 'OQpdSVF_k_w')
|
||||
original_video_id = 'OQpdSVF_k_w'
|
||||
self.assertTrue(original_video_id in {entry['id'] for entry in entries})
|
||||
|
||||
def test_youtube_toptracks(self):
|
||||
print('Skipping: The playlist page gives error 500')
|
||||
|
@ -2781,8 +2781,7 @@ class YoutubePlaylistIE(YoutubePlaylistBaseInfoExtractor):
|
||||
webpage = self._download_webpage(
|
||||
url, playlist_id, 'Downloading page {0} of Youtube mix'.format(n))
|
||||
new_ids = orderedSet(re.findall(
|
||||
r'''(?xs)data-video-username=".*?".*?
|
||||
href="/watch\?v=([0-9A-Za-z_-]{11})&[^"]*?list=%s''' % re.escape(playlist_id),
|
||||
r'[\'"]/watch\?v=([0-9A-Za-z_-]{11})(?:&|\\u0026)[^"]*?list=%s' % re.escape(playlist_id),
|
||||
webpage))
|
||||
# Fetch new pages until all the videos are repeated, it seems that
|
||||
# there are always 51 unique videos.
|
||||
|
Loading…
Reference in New Issue
Block a user