Rstrip the "Z" off of timestamps.

This only started occuring recently.
master
voussoir 2020-05-06 21:23:24 -07:00
parent cd7a59cbfa
commit e165b16edc
1 changed files with 1 additions and 0 deletions

View File

@ -30,6 +30,7 @@ class Video:
# Something like '2016-10-01T21:00:01' # Something like '2016-10-01T21:00:01'
self.published_string = snippet['publishedAt'] self.published_string = snippet['publishedAt']
published = snippet['publishedAt'].split('.')[0] published = snippet['publishedAt'].split('.')[0]
published = published.rstrip('Z')
published = datetime.datetime.strptime(published, '%Y-%m-%dT%H:%M:%S') published = datetime.datetime.strptime(published, '%Y-%m-%dT%H:%M:%S')
self.published = published.timestamp() self.published = published.timestamp()