summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSergey M․ <[email protected]>2021-01-16 09:42:11 +0700
committerSergey M․ <[email protected]>2021-01-16 09:42:57 +0700
commitf1487d4fca40fd37d735753e24a7bae53a1b1513 (patch)
tree07b0a9413d419155503658b331a3e7b51878a1fa
parent0cd4c402f0530d357bb11b660e14a303290f6caf (diff)
downloadyoutube-dl-f1487d4fca40fd37d735753e24a7bae53a1b1513.tar.gz
youtube-dl-f1487d4fca40fd37d735753e24a7bae53a1b1513.zip
[mixcloud:playlist:base] Fix video id extraction in flat playlist mode (refs #27787)
-rw-r--r--youtube_dl/extractor/mixcloud.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/youtube_dl/extractor/mixcloud.py b/youtube_dl/extractor/mixcloud.py
index 37f16a791..69319857d 100644
--- a/youtube_dl/extractor/mixcloud.py
+++ b/youtube_dl/extractor/mixcloud.py
@@ -251,11 +251,9 @@ class MixcloudPlaylistBaseIE(MixcloudBaseIE):
cloudcast_url = cloudcast.get('url')
if not cloudcast_url:
continue
- video_id = cloudcast.get('slug')
- if video_id:
- owner_username = try_get(cloudcast, lambda x: x['owner']['username'], compat_str)
- if owner_username:
- video_id = '%s_%s' % (owner_username, video_id)
+ slug = try_get(cloudcast, lambda x: x['slug'], compat_str)
+ owner_username = try_get(cloudcast, lambda x: x['owner']['username'], compat_str)
+ video_id = '%s_%s' % (owner_username, slug) if slug and owner_username else None
entries.append(self.url_result(
cloudcast_url, MixcloudIE.ie_key(), video_id))