[mixcloud:playlist:base] Fix video id extraction in flat playlist mod…

…e (refs #27787)
This commit is contained in:
=?UTF-8?q?Sergey=20M=E2=80=A4?= 2021-02-26 16:13:15 +01:00 committed by Dominika
parent 6f17f97383
commit 79a5e77e79

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