Skip to content

A feature-rich command-line audio/video downloader

python2: don't use str, use compat_str

insaneracist5c15c1a0d7c2
diff --git a/youtube_dlc/extractor/youtube.py b/youtube_dlc/extractor/youtube.py
index ad67fa4100..d8f0dab1f5 100644
--- a/youtube_dlc/extractor/youtube.py
+++ b/youtube_dlc/extractor/youtube.py
@@ -2813,11 +2813,11 @@ class YoutubePlaylistIE(YoutubePlaylistBaseInfoExtractor):
def _extract_mix_ids_from_yt_initial(self, yt_initial):
ids = []
- playlist_contents = try_get(yt_initial, lambda x: x['contents']['twoColumnWatchNextResults']['playlist']['playlist']['contents'])
- if type(playlist_contents) is list:
+ playlist_contents = try_get(yt_initial, lambda x: x['contents']['twoColumnWatchNextResults']['playlist']['playlist']['contents'], list)
+ if playlist_contents:
for item in playlist_contents:
- videoId = try_get(item, lambda x: x['playlistPanelVideoRenderer']['videoId'])
- if type(videoId) is str:
+ videoId = try_get(item, lambda x: x['playlistPanelVideoRenderer']['videoId'], compat_str)
+ if videoId:
ids.append(videoId)
return ids