Conversation
|
I had to change line 83 to: |
|
Oh dang, it looks like it wasn't as simple as I was hoping. It turns out short videos have the thumbnail image in a format like But longer videos are in the format of Using By the way, youtube-dl uses the API with a guest token to get the video url (see twitter.py, relevant discussion here). As a workaround, the video url could be set to the tweet's url so at least tweets with videos don't get skipped. My use case for twitterscraper didn't include scraping tweets with long videos though, so I won't be fixing this myself, but hopefully these notes will be useful to someone else. |
The HTML element that the video url was getting scraped no longer exists, so
video_div.find('a')returnedNone, and this made tweets containing videos fail getting scraped.I changed it to use regex to extract the video id, and construct the video url from it.