mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-26 02:55:17 +00:00
python2: don't use str, use compat_str
This commit is contained in:
parent
712799bd30
commit
5c15c1a0d7
1 changed files with 4 additions and 4 deletions
|
@ -2813,11 +2813,11 @@ def extract_videos_from_page(self, page):
|
|||
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue