mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-01-31 20:42:29 +01:00
Use traverse_obj
This commit is contained in:
parent
2945d56992
commit
2b0f7e3f8a
1 changed files with 2 additions and 3 deletions
|
@ -647,7 +647,6 @@ class SoundcloudIE(SoundcloudBaseIE):
|
||||||
class SoundcloudPlaylistBaseIE(SoundcloudBaseIE):
|
class SoundcloudPlaylistBaseIE(SoundcloudBaseIE):
|
||||||
def _extract_set(self, playlist, token=None):
|
def _extract_set(self, playlist, token=None):
|
||||||
playlist_id = str(playlist['id'])
|
playlist_id = str(playlist['id'])
|
||||||
playlist_uploader = playlist.get('user') or {}
|
|
||||||
tracks = playlist.get('tracks') or []
|
tracks = playlist.get('tracks') or []
|
||||||
if not all(t.get('permalink_url') for t in tracks) and token:
|
if not all(t.get('permalink_url') for t in tracks) and token:
|
||||||
tracks = self._call_api(
|
tracks = self._call_api(
|
||||||
|
@ -673,8 +672,8 @@ class SoundcloudPlaylistBaseIE(SoundcloudBaseIE):
|
||||||
entries, playlist_id,
|
entries, playlist_id,
|
||||||
playlist.get('title'),
|
playlist.get('title'),
|
||||||
playlist.get('description'),
|
playlist.get('description'),
|
||||||
uploader=playlist_uploader.get('username'),
|
uploader=traverse_obj(playlist, ('user', 'username')),
|
||||||
uploader_id=str_or_none(playlist_uploader.get('id')))
|
uploader_id=str_or_none(traverse_obj(playlist, ('user', 'id'))))
|
||||||
|
|
||||||
|
|
||||||
class SoundcloudSetIE(SoundcloudPlaylistBaseIE):
|
class SoundcloudSetIE(SoundcloudPlaylistBaseIE):
|
||||||
|
|
Loading…
Add table
Reference in a new issue