From 99dec4d6ed065ba8da0ac2a7533d72f1b8759b6b Mon Sep 17 00:00:00 2001 From: DmitryScaletta Date: Thu, 15 Feb 2024 13:48:13 +0300 Subject: [PATCH] [PromoDJ] Add music format ids --- yt_dlp/extractor/promodj.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/yt_dlp/extractor/promodj.py b/yt_dlp/extractor/promodj.py index dae880352a..0c61b039ff 100644 --- a/yt_dlp/extractor/promodj.py +++ b/yt_dlp/extractor/promodj.py @@ -155,10 +155,11 @@ class PromoDJBaseIE(InfoExtractor): }) } - formats = [traverse_obj(source, { - 'url': ('URL', {url_or_none}), - 'size': ('size', {int_or_none}), - }) for source in traverse_obj(media_data, ('sources'))] + formats = [{ + 'format_id': 'lossy', + 'url': traverse_obj(source, ('URL', {url_or_none})), + 'size': traverse_obj(source, ('size', {int_or_none})), + } for source in traverse_obj(media_data, ('sources'))] thumbnails = [{ 'url': url, } for url in traverse_obj(media_data, ('coverURL', ('600', '1200', '2000'))) if url_or_none(url)] @@ -855,6 +856,7 @@ class PromoDJIE(PromoDJBaseIE): metadata['formats'][0]['abr'] = int(bitrate) elif url_or_none(url): metadata['formats'].append({ + 'format_id': 'lossless', 'url': url, 'abr': int(bitrate), })