Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds 'images_urls' and 'has_video' attributes to tweets #210

Closed
wants to merge 2 commits into from

Conversation

rezemika
Copy link

@rezemika rezemika commented Aug 9, 2019

Hi! I made small modifications to be able to download the images coming with a tweet. I thought it might be useful. :)

By the way, it's related to #200.

Now, a Tweet object contains:

  • an 'images_urls' attribute, which is a list containing the urls of the images of tweet;
  • a 'has_video' attribute, which a boolean, set to True if the tweet has a video, false either.

It is currently not possible to get the video url, because it does not come with the tweet HTML (it seems to be added after loading with Javascript).

Edit: Videos are added by an obfuscated script, which uses an API requiring parameters which are very difficult to get (they're hidden in an unreadable bloat of JS). The URL of the API is something like https://api.twitter.com/1.1/videos/tweet/config/XXX.json (with XXX = the ID of the tweet), it requires an authorization header and some cookies.

@taspinar
Copy link
Owner

@rezemika This looks like an useful addition, but don't you want to write the retrieved information to the output file?

Now, a Tweet object contains:
- an 'images_urls' attribute, which is a list containing the urls of the images of tweet;
- a 'has_video' attribute, which a boolean, set to True if the tweet has a video, false either.

It is currently not possible to get the video url, because it does not come with the tweet HTML (it seems to be added after loading with Javascript).
@rezemika
Copy link
Author

Oh, my bad, I forgot that. It should be fixed now. :)

@nukopy
Copy link
Contributor

nukopy commented Dec 26, 2019

This PR should be closed because the similar changes were merged on #231.

@rezemika rezemika closed this Dec 26, 2019
@rezemika rezemika deleted the tweet-images branch February 18, 2020 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants