mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-06-30 11:02:51 -05:00
Merge remote-tracking branch 'epitron/metadata-pp'
Conflicts: youtube_dl/PostProcessor.py
This commit is contained in:
@ -818,6 +818,15 @@ def date_from_str(date_str):
|
||||
return today + delta
|
||||
return datetime.datetime.strptime(date_str, "%Y%m%d").date()
|
||||
|
||||
def hyphenate_date(date_str):
|
||||
"""
|
||||
Convert a date in 'YYYYMMDD' format to 'YYYY-MM-DD' format"""
|
||||
match = re.match(r'^(\d\d\d\d)(\d\d)(\d\d)$', date_str)
|
||||
if match is not None:
|
||||
return '-'.join(match.groups())
|
||||
else:
|
||||
return date_str
|
||||
|
||||
class DateRange(object):
|
||||
"""Represents a time interval between two dates"""
|
||||
def __init__(self, start=None, end=None):
|
||||
|
Reference in New Issue
Block a user