Added '--xattrs' option which writes metadata to the file's extended attributes using a youtube-dl postprocessor.

Works on Linux, OSX, and Windows.
This commit is contained in:
epitron 2014-01-02 07:47:28 -05:00
parent 1b969041d7
commit e63fc1bed4
4 changed files with 139 additions and 2 deletions

View file

@ -809,6 +809,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):