diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-07-11 11:17:57 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-07-11 11:17:57 +0200 |
commit | fa19dfccf9ced09657bc27c870ba75a19690ebb7 (patch) | |
tree | abeedb751f186e7783027cf756772c0f50d7284e /youtube_dl/utils.py | |
parent | cdc22cb8861e95a874f0271c84dbc6be487e03fc (diff) | |
parent | e5c3a4b54995422dcef1d2fbb032446e35358e8d (diff) |
Merge remote-tracking branch 'tobidope/gameone'
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r-- | youtube_dl/utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 09312e81a..2cba2bfc1 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -775,7 +775,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: @@ -795,8 +795,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()) |