Search code examples
phptwitter

I have used twitterouth php Library. I am not able to fetch information for some videos


I have used twitterouth php Library for getting video information for videos. But for some videos I am not able to fetch information for some videos.

This is what i did:

$connection = new TwitterOAuth($cons_key, $cons_secret, $oauth_token, $oauth_token_secret);
$tweet = $connection->get('https://api.twitter.com/1.1/statuses/show.json?id='.$vidId.'&include_entities=true');

I am passing video_id in the API that i get from video link.

i am successfully getting mp4 link for videos.

But the issue is that API is not providing video details for some videos. It is returning only user info and no error or warning.

Here is the video link of which i need the details: https://twitter.com/carpclash/status/1247570290575650820?s=20

Can anyone help me to find the issue. that why info of some videos is not accessible.

Thanks.


Solution

  • Use this instead:

    $tweet = $connection->get('https://api.twitter.com/1.1/statuses/show.json?id='.$vidId.'&include_entities=true&tweet_mode=extended');