aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-10-29 20:10:00 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-10-29 20:10:00 +0100
commit6ad4013d40e839211e2896129eed05ccd40ee963 (patch)
tree3bf436a08494256f60ad6069635d6641b356612b /youtube_dl/utils.py
parent50c8266ef0b2b6d011257a909f47fd623dda8eb2 (diff)
[drtv] Allow fractional timestamps (Fixes #4059)
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 6c0c39ca5..2864e5142 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -925,7 +925,7 @@ def parse_iso8601(date_str, delimiter='T'):
return None
m = re.search(
- r'Z$| ?(?P<sign>\+|-)(?P<hours>[0-9]{2}):?(?P<minutes>[0-9]{2})$',
+ r'(\.[0-9]+)?(?:Z$| ?(?P<sign>\+|-)(?P<hours>[0-9]{2}):?(?P<minutes>[0-9]{2})$)',
date_str)
if not m:
timezone = datetime.timedelta()
@@ -938,7 +938,7 @@ def parse_iso8601(date_str, delimiter='T'):
timezone = datetime.timedelta(
hours=sign * int(m.group('hours')),
minutes=sign * int(m.group('minutes')))
- date_format = '%Y-%m-%d{0}%H:%M:%S'.format(delimiter)
+ 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())