desmondmorris / node-twitter

Client library for the Twitter REST and Streaming API's.

Home Page:https://www.npmjs.com/package/twitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Media entities always return images not video or gifs (Thumbnail image)

Bas950 opened this issue · comments

For this tweet I only get the following as media entity:

{
  id: 1291683183411437600,
  id_str: '1291683183411437568',
  indices: [ 149, 172 ],
  media_url: 'http://pbs.twimg.com/tweet_video_thumb/Eez7Av2VoAAK58T.jpg',
  media_url_https: 'https://pbs.twimg.com/tweet_video_thumb/Eez7Av2VoAAK58T.jpg',
  url: 'https://t.co/I3Clni8MeD',
  display_url: 'pic.twitter.com/I3Clni8MeD',
  expanded_url: 'https://twitter.com/_Weeekly/status/1291683199240695809/photo/1',
  type: 'photo',
  sizes: {
    thumb: { w: 150, h: 150, resize: 'crop' },
    medium: { w: 846, h: 1200, resize: 'fit' },
    large: { w: 1024, h: 1452, resize: 'fit' },
    small: { w: 480, h: 680, resize: 'fit' }
  }
}

This is the function I use:

let params = {
	screen_name: tweeter.tweeter,
	since_id: parseInt(tweeter.latestTweetId),
	include_rts: true,
	tweet_mode: "extended",
	count: 1000
};
twitterClient.get("statuses/user_timeline", params, async function (
	error,
	tweets
) { 
       //code
}

How can I get the gifs/video links from the user_timeline?

its in the extended enitities media object and in that object its in the video_info.variants