aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2018-03-14 01:28:40 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2018-03-14 09:55:21 +0100
commitf226880c6d44098b5e99b05a83ed739e18d15690 (patch)
treebf2a19ede60e2f39f67f53c9b6977c4dc402553b /youtube_dl/utils.py
parent08250b69c29f8fc3bb73c6461363472197a86f03 (diff)
[tennistv] Add support for tennistv.com
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index a21455f70..027d12785 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -1211,6 +1211,11 @@ def unified_timestamp(date_str, day_first=True):
if m:
date_str = date_str[:-len(m.group('tz'))]
+ # Python only supports microseconds, so remove nanoseconds
+ m = re.search(r'^([0-9]{4,}-[0-9]{1,2}-[0-9]{1,2}T[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}\.[0-9]{6})[0-9]+$', date_str)
+ if m:
+ date_str = m.group(1)
+
for expression in date_formats(day_first):
try:
dt = datetime.datetime.strptime(date_str, expression) - timezone + datetime.timedelta(hours=pm_delta)