]> jfr.im git - yt-dlp.git/commitdiff
Merge pull request #112 from insaneracist/youtube-mix-fix
authorTom-Oliver Heidel <redacted>
Thu, 5 Nov 2020 16:25:27 +0000 (17:25 +0100)
committerGitHub <redacted>
Thu, 5 Nov 2020 16:25:27 +0000 (17:25 +0100)
[youtube] fix: mix playlist title

youtube_dlc/extractor/youtube.py

index 2e70ad6fa19f3796934676235bb6a500eb93d107..025ea5e575fa755d54407c1530232e865851b3de 100644 (file)
@@ -2842,6 +2842,7 @@ def _extract_mix(self, playlist_id):
         # The mixes are generated from a single video
         # the id of the playlist is just 'RD' + video_id
         ids = []
+        yt_initial = None
         last_id = playlist_id[-11:]
         for n in itertools.count(1):
             url = 'https://www.youtube.com/watch?v=%s&list=%s' % (last_id, playlist_id)
@@ -2875,6 +2876,9 @@ def _extract_mix(self, playlist_id):
             or search_title('title'))
         title = clean_html(title_span)
 
+        if not title:
+            title = try_get(yt_initial, lambda x: x['contents']['twoColumnWatchNextResults']['playlist']['playlist']['title'], compat_str)
+
         return self.playlist_result(url_results, playlist_id, title)
 
     def _extract_playlist(self, playlist_id):