diff options
author | insaneracist <insaneracist@cyberdude.com> | 2020-11-02 14:54:47 -0800 |
---|---|---|
committer | insaneracist <insaneracist@cyberdude.com> | 2020-11-02 14:54:47 -0800 |
commit | 5c15c1a0d7c27d34e7d03161c5b27bf923e314cd (patch) | |
tree | 851021534cd352268d32b753d4d82b444f4725ee | |
parent | 712799bd30f26ce1b8a2931a73cdc7448f736964 (diff) | |
download | hypervideo-pre-5c15c1a0d7c27d34e7d03161c5b27bf923e314cd.tar.lz hypervideo-pre-5c15c1a0d7c27d34e7d03161c5b27bf923e314cd.tar.xz hypervideo-pre-5c15c1a0d7c27d34e7d03161c5b27bf923e314cd.zip |
python2: don't use str, use compat_str
-rw-r--r-- | youtube_dlc/extractor/youtube.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/youtube_dlc/extractor/youtube.py b/youtube_dlc/extractor/youtube.py index ad67fa410..d8f0dab1f 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 |