aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/anvato.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-11-06 06:35:24 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-11-06 07:53:55 +0530
commit34921b43451a23d8cd7350f8511269bdfd35cf61 (patch)
tree4cc0f567f0b159299b41de0b2b372e066936be3f /yt_dlp/extractor/anvato.py
parenta331949df396d69e648fad61a80ada5da3279704 (diff)
downloadhypervideo-pre-34921b43451a23d8cd7350f8511269bdfd35cf61.tar.lz
hypervideo-pre-34921b43451a23d8cd7350f8511269bdfd35cf61.tar.xz
hypervideo-pre-34921b43451a23d8cd7350f8511269bdfd35cf61.zip
[utils] Add `join_nonempty`
Diffstat (limited to 'yt_dlp/extractor/anvato.py')
-rw-r--r--yt_dlp/extractor/anvato.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/yt_dlp/extractor/anvato.py b/yt_dlp/extractor/anvato.py
index d688e2c5b..0d444fc33 100644
--- a/yt_dlp/extractor/anvato.py
+++ b/yt_dlp/extractor/anvato.py
@@ -16,6 +16,7 @@ from ..utils import (
determine_ext,
intlist_to_bytes,
int_or_none,
+ join_nonempty,
strip_jsonp,
unescapeHTML,
unsmuggle_url,
@@ -303,13 +304,13 @@ class AnvatoIE(InfoExtractor):
tbr = int_or_none(published_url.get('kbps'))
a_format = {
'url': video_url,
- 'format_id': ('-'.join(filter(None, ['http', published_url.get('cdn_name')]))).lower(),
- 'tbr': tbr if tbr != 0 else None,
+ 'format_id': join_nonempty('http', published_url.get('cdn_name')).lower(),
+ 'tbr': tbr or None,
}
if media_format == 'm3u8' and tbr is not None:
a_format.update({
- 'format_id': '-'.join(filter(None, ['hls', compat_str(tbr)])),
+ 'format_id': join_nonempty('hls', tbr),
'ext': 'mp4',
})
elif media_format == 'm3u8-variant' or ext == 'm3u8':