New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Twitter video media upload not working : Error: HTTP Error: 400 Bad Request #296
Comments
same issue at my end when trying with GIF.. Can you help me out? |
@harvinder-ss What exactly error are you facing? |
I have got it working now. thanks |
@harvinder-ss I am having the same issue, how did you resolve it? |
hi @ljmocic Twitter does not allow Video and gif to be posted in single upload command. You have to first Init the media upload and then Append the request by using the ID returned from Init. check this for more details : https://developer.twitter.com/en/docs/media/upload-media/api-reference/post-media-upload-append |
I've figured out in the meantime, but thank you very much for the response! |
@ljmocic Can you please tell the solution? I went through the twitter docs as well as the examples of this package thoroughly but still, I am getting
in the FINALIZE step |
Update: The error was getting produced by the STATUS step and after removing it the code just works fine. I think the STATUS step is not supported by the package. |
@neer17 , @ljmocic, @harvinder-ss can anyone show me a working example?? |
I think that my solution was to use another package. Here is how you can solve it with
|
@ashatat See this chunked media example it is their official example. @ashatat If the error still persists after removing the STATUS step then please put your code along with the error stack |
@neer17 I understand, but this was the only use case that I needed to cover in my script. Maybe you could look up in the implementation inside that package, so you can extend the functionality of this one. |
@ljmocic I did some tweaks to my code, but it worked only for some images and some videos, which is weird |
@ashatat Are you making sure that all the images and videos are under 5MB and 15MB resp.? |
@neer17 |
Why does this library not give you there error response from twitter? If we knew what the error was from twitter it would be easier to debug. |
I was able to view the error by changing the promise rejection from
to
In my case it was "InvalidContent". Maybe they don't accept quicktime format, only mp4? |
This stackoverflow example worked for me https://stackoverflow.com/a/47633263/15143364 for video chunk upload. Please check and let me know if guys are still facing some issues. |
I am trying upload and post video media to the twitter using 'twitter' npm package.
During this I am facing an error :
Codebase
Initialize library
All details generate through twitter app console.
// This request about to complete
// This request is not working.
Video Used :
https://www.sample-videos.com/video/mp4/360/big_buck_bunny_360p_1mb.mp4
Reference : https://github.com/desmondmorris/node-twitter/tree/master/examples#chunked-media
The text was updated successfully, but these errors were encountered: