mirror of
https://gitlab.com/jeancf/twoot.git
synced 2024-11-23 20:11:11 +00:00
Fixed float timestamp bug
This commit is contained in:
parent
156df6040c
commit
93f8e493db
6
twoot.py
6
twoot.py
|
@ -887,10 +887,10 @@ def main(argv):
|
|||
# Extract time stamp
|
||||
time_string = status.find('span', class_='tweet-date').a.get('title')
|
||||
try:
|
||||
timestamp = datetime.strptime(time_string, '%d/%m/%Y, %H:%M:%S').timestamp()
|
||||
timestamp = datetime.strptime(time_string, '%d/%m/%Y, %H:%M:%S')
|
||||
except:
|
||||
# Dec 21, 2021 · 12:00 PM UTC
|
||||
timestamp = datetime.strptime(time_string, '%b %d, %Y · %I:%M %p %Z').timestamp()
|
||||
timestamp = datetime.strptime(time_string, '%b %d, %Y · %I:%M %p %Z')
|
||||
|
||||
# Check if time is within acceptable range
|
||||
if not is_time_valid(timestamp):
|
||||
|
@ -1024,7 +1024,7 @@ def main(argv):
|
|||
tweet = {
|
||||
"author": author,
|
||||
"author_account": author_account,
|
||||
"timestamp": timestamp,
|
||||
"timestamp": timestamp.timestamp(),
|
||||
"tweet_id": tweet_id,
|
||||
"tweet_text": tweet_text,
|
||||
"video": video_file,
|
||||
|
|
Loading…
Reference in New Issue
Block a user