Rstrip the "Z" off of timestamps.

This only started occuring recently.
This commit is contained in:
voussoir 2020-05-06 21:23:24 -07:00
parent cd7a59cbfa
commit e165b16edc

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