mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-12-18 03:42:23 +01:00
[utils] Add join_nonempty
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..utils import int_or_none
|
||||
from ..utils import int_or_none, join_nonempty
|
||||
|
||||
|
||||
class TOnlineIE(InfoExtractor):
|
||||
@@ -30,13 +30,8 @@ class TOnlineIE(InfoExtractor):
|
||||
asset_source = asset.get('source') or asset.get('source2')
|
||||
if not asset_source:
|
||||
continue
|
||||
formats_id = []
|
||||
for field_key in ('type', 'profile'):
|
||||
field_value = asset.get(field_key)
|
||||
if field_value:
|
||||
formats_id.append(field_value)
|
||||
formats.append({
|
||||
'format_id': '-'.join(formats_id),
|
||||
'format_id': join_nonempty('type', 'profile', from_dict=asset),
|
||||
'url': asset_source,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user