[gameone] Added timestamp extraction
This commit is contained in:
parent
a231ce87b5
commit
305d068362
2 changed files with 14 additions and 6 deletions
|
@ -765,7 +765,7 @@ class YoutubeDLHandler(compat_urllib_request.HTTPHandler):
|
|||
https_response = http_response
|
||||
|
||||
|
||||
def parse_iso8601(date_str):
|
||||
def parse_iso8601(date_str, delimiter='T'):
|
||||
""" Return a UNIX timestamp from the given date """
|
||||
|
||||
if date_str is None:
|
||||
|
@ -785,8 +785,8 @@ def parse_iso8601(date_str):
|
|||
timezone = datetime.timedelta(
|
||||
hours=sign * int(m.group('hours')),
|
||||
minutes=sign * int(m.group('minutes')))
|
||||
|
||||
dt = datetime.datetime.strptime(date_str, '%Y-%m-%dT%H:%M:%S') - timezone
|
||||
date_format = '%Y-%m-%d{0}%H:%M:%S'.format(delimiter)
|
||||
dt = datetime.datetime.strptime(date_str, date_format) - timezone
|
||||
return calendar.timegm(dt.timetuple())
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue