aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorinsaneracist <insaneracist@cyberdude.com>2020-11-03 07:15:16 -0800
committerinsaneracist <insaneracist@cyberdude.com>2020-11-03 07:15:16 -0800
commit15f6397c197af9ad464b2c385e3c8d4192aadb07 (patch)
treed2849853c01f7757d7bab739a5bc51144ef48f67
parent5c15c1a0d7c27d34e7d03161c5b27bf923e314cd (diff)
downloadhypervideo-pre-15f6397c197af9ad464b2c385e3c8d4192aadb07.tar.lz
hypervideo-pre-15f6397c197af9ad464b2c385e3c8d4192aadb07.tar.xz
hypervideo-pre-15f6397c197af9ad464b2c385e3c8d4192aadb07.zip
[youtube] get mix playlist title from ytInitialData
-rw-r--r--youtube_dlc/extractor/youtube.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/youtube_dlc/extractor/youtube.py b/youtube_dlc/extractor/youtube.py
index d8f0dab1f..d736daa40 100644
--- a/youtube_dlc/extractor/youtube.py
+++ b/youtube_dlc/extractor/youtube.py
@@ -2825,6 +2825,7 @@ class YoutubePlaylistIE(YoutubePlaylistBaseInfoExtractor):
# 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)
@@ -2858,6 +2859,9 @@ class YoutubePlaylistIE(YoutubePlaylistBaseInfoExtractor):
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):