[mixcloud:playlist:base] Fix video id extraction in flat playlist mode (refs #27787)

pull/19654/merge
Sergey M․ 2021-01-16 09:42:11 +07:00
parent 0cd4c402f0
commit f1487d4fca
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D
1 changed files with 3 additions and 5 deletions

View File

@ -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))