mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-10-01 21:54:55 +00:00
[cleanup] Misc
This commit is contained in:
@@ -6161,8 +6161,11 @@ def to_high_limit_path(path):
|
||||
return path
|
||||
|
||||
|
||||
def format_field(obj, field, template='%s', ignore=(None, ''), default='', func=None):
|
||||
val = obj.get(field, default)
|
||||
def format_field(obj, field=None, template='%s', ignore=(None, ''), default='', func=None):
|
||||
if field is None:
|
||||
val = obj if obj is not None else default
|
||||
else:
|
||||
val = obj.get(field, default)
|
||||
if func and val not in ignore:
|
||||
val = func(val)
|
||||
return template % val if val not in ignore else default
|
||||
|
Reference in New Issue
Block a user