aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorTobias Bell <tobias.bell@gmail.com>2014-05-17 19:04:02 +0200
committerTobias Bell <tobias.bell@gmail.com>2014-05-17 19:04:02 +0200
commit305d0683628d26c8e9ba04c77c4b3c7283106f80 (patch)
tree354baf86d5a9e67321f04245c05ce2fe45c6940a /youtube_dl/utils.py
parenta231ce87b56d85354f66d4a9b26763bc73ca86c1 (diff)
downloadyoutube-dl-305d0683628d26c8e9ba04c77c4b3c7283106f80.tar.xz
[gameone] Added timestamp extraction
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 1036ea9bd..3e7947f5d 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -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())