fossasia / loklak_wok_android

"loklak wok" is a harvesting peer for the loklak_server https://github.com/fossasia/loklak_wok_android/raw/apk/loklak_wok_1.2_20160201.apk
GNU Lesser General Public License v2.1
1.56k stars 89 forks source link

Tweet posting with media_ids fails #46

Open SKrPl opened 7 years ago

SKrPl commented 7 years ago

Parent issue: https://github.com/fossasia/loklak_wok_android/issues/41

Steps to post a tweet with media:

  1. Obtain media ID using POST media/upload twitter API endpoint: https://dev.twitter.com/rest/reference/post/media/upload-init (Media ID is obtained for small files, without using APPEND and FINIALIZE command).
  2. Use the obtained media ID in statuses/update(https://dev.twitter.com/rest/reference/post/statuses/update) by providing the media ID in media_ids parameter. This request throws an HTTPException 400, and with an error message:
    {"errors":[{"code":324,"message":"Invalid media id 889241623330263044"}]}

Tried to test the request with twurl and an Webapp developed by a twitter team member (http://django-rest-apis.herokuapp.com/media/video), both of it throw the same error (mentioned above).

Searched a bit about this and found the following discussions:

A demo app that can be used to verify this error, link: https://github.com/SKrPl/TwitterMultimedia

SKrPl commented 7 years ago

@mariobehling @Orbiter @sudheesh001 @daminisatya Please help. How should I proceed?

abishekvashok commented 7 years ago

https://dev.twitter.com/rest/public/uploading-media

Supported image media types: JPG, PNG, GIF, WEBP Image size <= 5 MB, animated GIF size <= 15 MB

SKrPl commented 7 years ago

@abishekvashok Yes, the image I tried was of JPG type and the size was 34KiB.

abishekvashok commented 6 years ago

Twitter reject photos and videos that have less color in it.

abishekvashok commented 6 years ago

Post media_id_string instead of media_id @SKrPI