1
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-01-19 07:13:05 +01:00

Use traverse_obj

This commit is contained in:
7x11x13 2024-12-29 14:33:01 -05:00
parent 2945d56992
commit 2b0f7e3f8a

View file

@ -647,7 +647,6 @@ class SoundcloudIE(SoundcloudBaseIE):
class SoundcloudPlaylistBaseIE(SoundcloudBaseIE):
def _extract_set(self, playlist, token=None):
playlist_id = str(playlist['id'])
playlist_uploader = playlist.get('user') or {}
tracks = playlist.get('tracks') or []
if not all(t.get('permalink_url') for t in tracks) and token:
tracks = self._call_api(
@ -673,8 +672,8 @@ class SoundcloudPlaylistBaseIE(SoundcloudBaseIE):
entries, playlist_id,
playlist.get('title'),
playlist.get('description'),
uploader=playlist_uploader.get('username'),
uploader_id=str_or_none(playlist_uploader.get('id')))
uploader=traverse_obj(playlist, ('user', 'username')),
uploader_id=str_or_none(traverse_obj(playlist, ('user', 'id'))))
class SoundcloudSetIE(SoundcloudPlaylistBaseIE):