1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2026-02-16 21:45:44 +00:00

[utils] Add join_nonempty

This commit is contained in:
pukkandan
2021-11-06 06:35:24 +05:30
parent a331949df3
commit 34921b4345
24 changed files with 82 additions and 131 deletions

View File

@@ -15,6 +15,7 @@ from ..utils import (
float_or_none,
HEADRequest,
int_or_none,
join_nonempty,
RegexNotFoundError,
sanitized_Request,
strip_or_none,
@@ -99,9 +100,9 @@ class MTVServicesInfoExtractor(InfoExtractor):
formats.extend([{
'ext': 'flv' if rtmp_video_url.startswith('rtmp') else ext,
'url': rtmp_video_url,
'format_id': '-'.join(filter(None, [
'format_id': join_nonempty(
'rtmp' if rtmp_video_url.startswith('rtmp') else None,
rendition.get('bitrate')])),
rendition.get('bitrate')),
'width': int(rendition.get('width')),
'height': int(rendition.get('height')),
}])