mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-03-09 12:50:23 -05:00
Requested changes
This commit is contained in:
parent
fae148b2df
commit
1a449af19e
2 changed files with 3 additions and 3 deletions
|
@ -8,8 +8,6 @@
|
|||
import subprocess
|
||||
import time
|
||||
|
||||
from yt_dlp.utils._utils import strftime_or_none
|
||||
|
||||
from .common import PostProcessor
|
||||
from ..compat import imghdr
|
||||
from ..utils import (
|
||||
|
@ -30,6 +28,7 @@
|
|||
prepend_extension,
|
||||
replace_extension,
|
||||
shell_quote,
|
||||
strftime_or_none,
|
||||
traverse_obj,
|
||||
variadic,
|
||||
write_json_file,
|
||||
|
@ -753,7 +752,7 @@ def add(meta_list, info_list=None, convert=str):
|
|||
# https://kodi.wiki/view/Video_file_tagging
|
||||
|
||||
add('title', ('track', 'title'))
|
||||
add('date', ('release_date', 'upload_date'), lambda date: strftime_or_none(date, '%Y-%m-%d'))
|
||||
add('date', ('release_date', 'upload_date'), convert=strftime_or_none(date_format='%Y-%m-%d'))
|
||||
add(('description', 'synopsis'), 'description')
|
||||
add(('purl', 'comment'), 'webpage_url')
|
||||
add('track', 'track_number')
|
||||
|
|
|
@ -2046,6 +2046,7 @@ def url_or_none(url):
|
|||
return url if re.match(r'(?:(?:https?|rt(?:m(?:pt?[es]?|fp)|sp[su]?)|mms|ftps?):)?//', url) else None
|
||||
|
||||
|
||||
@partial_application
|
||||
def strftime_or_none(timestamp, date_format='%Y%m%d', default=None):
|
||||
datetime_object = None
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue