diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-11-06 06:35:24 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-11-06 07:53:55 +0530 |
commit | 34921b43451a23d8cd7350f8511269bdfd35cf61 (patch) | |
tree | 4cc0f567f0b159299b41de0b2b372e066936be3f /yt_dlp/extractor/ustream.py | |
parent | a331949df396d69e648fad61a80ada5da3279704 (diff) | |
download | hypervideo-pre-34921b43451a23d8cd7350f8511269bdfd35cf61.tar.lz hypervideo-pre-34921b43451a23d8cd7350f8511269bdfd35cf61.tar.xz hypervideo-pre-34921b43451a23d8cd7350f8511269bdfd35cf61.zip |
[utils] Add `join_nonempty`
Diffstat (limited to 'yt_dlp/extractor/ustream.py')
-rw-r--r-- | yt_dlp/extractor/ustream.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/yt_dlp/extractor/ustream.py b/yt_dlp/extractor/ustream.py index 8b758795f..4a7a8f879 100644 --- a/yt_dlp/extractor/ustream.py +++ b/yt_dlp/extractor/ustream.py @@ -13,6 +13,7 @@ from ..utils import ( ExtractorError, int_or_none, float_or_none, + join_nonempty, mimetype2ext, str_or_none, ) @@ -139,8 +140,8 @@ class UstreamIE(InfoExtractor): content_type = stream['contentType'] kind = content_type.split('/')[0] f = { - 'format_id': '-'.join(filter(None, [ - 'dash', kind, str_or_none(stream.get('bitrate'))])), + 'format_id': join_nonempty( + 'dash', kind, str_or_none(stream.get('bitrate'))), 'protocol': 'http_dash_segments', # TODO: generate a MPD doc for external players? 'url': encode_data_uri(b'<MPD/>', 'text/xml'), |