From 137f07c27a88b07df57df5b2cdebebe3c7722bac Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 5 Aug 2024 11:06:10 +0200 Subject: Merging upstream version 2024.07.01. Signed-off-by: Daniel Baumann --- yt_dlp/extractor/yandexdisk.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'yt_dlp/extractor/yandexdisk.py') diff --git a/yt_dlp/extractor/yandexdisk.py b/yt_dlp/extractor/yandexdisk.py index d5eecbd..3214816 100644 --- a/yt_dlp/extractor/yandexdisk.py +++ b/yt_dlp/extractor/yandexdisk.py @@ -5,6 +5,7 @@ from ..utils import ( determine_ext, float_or_none, int_or_none, + join_nonempty, mimetype2ext, try_get, urljoin, @@ -102,7 +103,7 @@ class YandexDiskIE(InfoExtractor): 'format_id': 'source', 'ext': determine_ext(title, meta.get('ext') or mimetype2ext(meta.get('mime_type')) or 'mp4'), 'quality': 1, - 'filesize': int_or_none(meta.get('size')) + 'filesize': int_or_none(meta.get('size')), }) for video in (video_streams.get('videos') or []): @@ -116,12 +117,9 @@ class YandexDiskIE(InfoExtractor): else: size = video.get('size') or {} height = int_or_none(size.get('height')) - format_id = 'hls' - if height: - format_id += '-%dp' % height formats.append({ 'ext': 'mp4', - 'format_id': format_id, + 'format_id': join_nonempty('hls', height and f'{height}p'), 'height': height, 'protocol': 'm3u8_native', 'url': format_url, -- cgit v1.2.3