Rishikant181 / Rettiwt-API

A CLI tool and an API for fetching data from Twitter for free!
https://rishikant181.github.io/Rettiwt-API/
MIT License
309 stars 31 forks source link

Trying to search tweet by tweet ID #362

Closed MsVoxxie closed 10 months ago

MsVoxxie commented 10 months ago

Is this a current possibility? Or is there some other method? There is no current documentation on TweetFilter that I can find.

Rishikant181 commented 10 months ago

Look into tweet.details method.

Usage example:

const { Rettiwt } = require('rettiwt-api');

// Creating a new Rettiwt instance using the API_KEY
const rettiwt = new Rettiwt(API_KEY);

// Fetching the details of the tweet with the given <id>
rettiwt.tweet.details('<id>')
.then(details => {
    ...
})
.catch(error => {
    ...
});
MsVoxxie commented 10 months ago

Look into tweet.details method.

Usage example:

const { Rettiwt } = require('rettiwt-api');

// Creating a new Rettiwt instance using the API_KEY
const rettiwt = new Rettiwt(API_KEY);

// Fetching the details of the user whose username is <username>
rettiwt.tweet.details('<id>')
.then(details => {
  ...
})
.catch(error => {
  ...
});

Oh I completely missed this, I apologise! Thank you so much

MsVoxxie commented 10 months ago

I apologise again, one second question. Is it a limitation of the method which this package is using to obtain the video url of a tweet? Or is it possible to get the video / media of a tweet?

Rishikant181 commented 10 months ago

The video/media URL can be obtained from the entities.media field of the returned tweet. The media can then be downloaded using a separate HTTP request to the received URL.

Since this API uses reverse engineered API endpoints of the Twitter client applications, this is the way by which media contents are received.

TL;DR The returned tweet contains the URL to the media and not the full media file.

MsVoxxie commented 10 months ago

The video/media URL can be obtained from the entities.media field of the returned tweet. The media can then be downloaded using a separate HTTP request to the received URL.

Since this API uses reverse engineered API endpoints of the Twitter client applications, this is the way by which media contents are received.

TL;DR The returned tweet contains the URL to the media and not the full media file.

I see, Though when testing tweet ID's of tweets with videos the media tab returns jpg's or png's and never a video to be requested

Rishikant181 commented 10 months ago

Sorry I understood your question wrong :P.

And

Is it a limitation of the method which this package is using to obtain the video url of a tweet?

Yes, it's a limitation as of now (probably because dumb me just totally forgot about videos inside tweets).

I'm opening up a separate issue and will try to implement it in the next feature update. Thanks for the feedback!

MsVoxxie commented 10 months ago

Oh awesome, I'd absolutely love video endpoints being reachable. Thanks so much :)