mirror of
https://gitlab.com/jeancf/twoot.git
synced 2024-11-23 20:11:11 +00:00
Ignore timeline-item without tweet-link tag
This commit is contained in:
parent
b69ac01b3c
commit
2327294af3
7
twoot.py
7
twoot.py
|
@ -975,7 +975,12 @@ def main(argv):
|
|||
in_db_cnt = 0
|
||||
for replied_to_tweet, status in timeline:
|
||||
# Extract tweet ID and status ID
|
||||
tweet_id = status.find('a', class_='tweet-link').get('href').strip('#m')
|
||||
tweet_link_tag = status.find('a', class_='tweet-link')
|
||||
if tweet_link_tag is None:
|
||||
logging.debug("Malformed timeline item (no tweet link), skipping")
|
||||
continue
|
||||
|
||||
tweet_id = tweet_link_tag.get('href').strip('#m')
|
||||
status_id = tweet_id.split('/')[3]
|
||||
|
||||
logging.debug('processing tweet %s', tweet_id)
|
||||
|
|
Loading…
Reference in New Issue
Block a user