[tennistv] Add support for tennistv.com

This commit is contained in:
Philipp Hagemeister 2018-03-14 01:28:40 +01:00
parent 08250b69c2
commit f226880c6d
4 changed files with 120 additions and 0 deletions

View file

@ -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)