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/funimation.py | |
parent | a331949df396d69e648fad61a80ada5da3279704 (diff) |
[utils] Add `join_nonempty`
Diffstat (limited to 'yt_dlp/extractor/funimation.py')
-rw-r--r-- | yt_dlp/extractor/funimation.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/yt_dlp/extractor/funimation.py b/yt_dlp/extractor/funimation.py index 382cbe159..42711083e 100644 --- a/yt_dlp/extractor/funimation.py +++ b/yt_dlp/extractor/funimation.py @@ -10,6 +10,7 @@ from ..compat import compat_HTTPError from ..utils import ( determine_ext, int_or_none, + join_nonempty, js_to_json, orderedSet, qualities, @@ -288,10 +289,11 @@ class FunimationIE(FunimationBaseIE): sub_type = sub_type if sub_type != 'FULL' else None current_sub = { 'url': text_track['src'], - 'name': ' '.join(filter(None, (version, text_track.get('label'), sub_type))) + 'name': join_nonempty(version, text_track.get('label'), sub_type, delim=' ') } - lang = '_'.join(filter(None, ( - text_track.get('language', 'und'), version if version != 'Simulcast' else None, sub_type))) + lang = join_nonempty(text_track.get('language', 'und'), + version if version != 'Simulcast' else None, + sub_type, delim='_') if current_sub not in subtitles.get(lang, []): subtitles.setdefault(lang, []).append(current_sub) return subtitles |