vladkens / twscrape

2024! X / Twitter API scrapper with authorization support. Allows you to scrape search results, User's profiles (followers/following), Tweets (favoriters/retweeters) and more.
https://pypi.org/project/twscrape/
MIT License
793 stars 104 forks source link

Return All Tweets Media as empty #144

Closed toomtoom closed 2 months ago

toomtoom commented 3 months ago

All Tweets return api.user_tweets(user_id, limit=tweet_number) the Media Fields are Empty? "media": { "photos": [], "videos": [], "animated": [] },

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

vladkens commented 2 months ago

@toomtoom if tweet don't have ant media this fields will be empty.

twscrape tweet_details 1780638545725550609 | jq
{
  "id": 1780638545725550609,
  "id_str": "1780638545725550609",
  "url": "https://twitter.com/stats_feed/status/1780638545725550609",
  "date": "2024-04-17 16:44:46+00:00",
  // ...
  "lang": "en",
  "rawContent": "What comes to mind when you think of Poland? https://t.co/Swe6o3XT0i",
  "replyCount": 1893,
  "retweetCount": 198,
  "likeCount": 3803,
  "quoteCount": 318,
  "conversationId": 1780638545725550609,
  "conversationIdStr": "1780638545725550609",
  "hashtags": [],
  "cashtags": [],
  "mentionedUsers": [],
  "links": [],
  "viewCount": 1083715,
  "retweetedTweet": null,
  "quotedTweet": null,
  "place": null,
  "coordinates": null,
  "inReplyToTweetId": null,
  "inReplyToTweetIdStr": null,
  "inReplyToUser": null,
  "source": "<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>",
  "sourceUrl": "http://twitter.com/download/iphone",
  "sourceLabel": "Twitter for iPhone",
  "media": {
    "photos": [
      {
        "url": "https://pbs.twimg.com/media/GLYZUWDXsAESJej.jpg"
      }
    ],
    "videos": [],
    "animated": []
  },
  "card": null,
  "_type": "snscrape.modules.twitter.Tweet"
}

Some tweets have media in card field, which will be added in v0.12. Details here: #46, #72, #157