mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-11-02 15:45:18 +00:00
[utils] Add join_nonempty
This commit is contained in:
@@ -8,6 +8,7 @@ from ..utils import (
|
||||
determine_ext,
|
||||
ExtractorError,
|
||||
int_or_none,
|
||||
join_nonempty,
|
||||
js_to_json,
|
||||
mimetype2ext,
|
||||
try_get,
|
||||
@@ -139,13 +140,9 @@ class DVTVIE(InfoExtractor):
|
||||
label = video.get('label')
|
||||
height = self._search_regex(
|
||||
r'^(\d+)[pP]', label or '', 'height', default=None)
|
||||
format_id = ['http']
|
||||
for f in (ext, label):
|
||||
if f:
|
||||
format_id.append(f)
|
||||
formats.append({
|
||||
'url': video_url,
|
||||
'format_id': '-'.join(format_id),
|
||||
'format_id': join_nonempty('http', ext, label),
|
||||
'height': int_or_none(height),
|
||||
})
|
||||
self._sort_formats(formats)
|
||||
|
||||
Reference in New Issue
Block a user