Rishikant181 / Rettiwt-API

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

Cant upload videos? #496

Open AlejandroAkbal opened 8 months ago

AlejandroAkbal commented 8 months ago

Hi, Im trying to upload a 30 sec MP4 file but I get this issue

Error: BAD_REQUEST
    at HttpError.RettiwtError [as constructor] (/home/node/.n8n/nodes/node_modules/rettiwt-api/src/models/errors/RettiwtError.ts:8:3)

WARNING NSFW Video URL for debugging: https://cdn.donmai.us/original/7a/27/7a27a9f0702a965a4dd16b482bff3eea.mp4

Some guidelines about videos https://help.twitter.com/en/using-x/x-videos

Rishikant181 commented 8 months ago

Uploading of any media above size 5 MB is not supported yet. The video you provided is of size 28.7 MB unfortunately.

AlejandroAkbal commented 8 months ago

Darn, is there an ETA for uploading media bigger than 5MB?

Guidelines says that videos could be up to 512MB, maybe you can bump it that far? Or remove limit altogether and let Twitter throw the exception

Rishikant181 commented 8 months ago

What Twitter does is when you upload a large video, it divides them into segments. This segmentation has currently not been implemented in Rettiwt-API, unfortunately. It will be in the future, but currently I'm working on some under the hood changes for the next major version.

AlejandroAkbal commented 8 months ago

Very interesting, good luck with the under the hood changes, you are making an incredible library

AlejandroAkbal commented 7 months ago

Hopefully its on the next release, its the most important bit for me

Rishikant181 commented 7 months ago

Just started working on it. Sorry for the late reply :(

AlejandroAkbal commented 7 months ago

Don't worry Rishi, thanks for getting back to me!

Rishikant181 commented 7 months ago

Guidelines says that videos could be up to 512MB, maybe you can bump it that far?

Just verified it and it turns out, 512MB limit only works for the Twitter App on phones. For the web app (whose API endpoints are used by this library), the max media limit is 5MB :(

I'll see if it's possible to reverse engineer those mobile app endpoints.

AlejandroAkbal commented 7 months ago

Very weird :(, I wish you the best of luck with reverse engineering

AlejandroAkbal commented 6 months ago

Is this now possible with version 3?

Rishikant181 commented 6 months ago

Nope. It's possible only on mobile endpoints and I'm yet to start work on it. I fear it will take some time before it's possible.

If it proves to be possible, it will most probably be pushed as a minor feature update to version 3, so no breaking changes.