3

Im using Tweetinvi and can upload files < 15MB without problem. however over that it fails, even though the Twitter API official docs state "File size should not exceed 15 mb (sync) / 512 mb (async)". I had assumed Tweetinvi would be using async logic and therefore should work, but seems not.

Any ideas if Im doing anything wrong or simply if Tweetinvi doesnt allow this.

Thanks in advance.

1

I am the developer of Tweetinvi.

When the upload was implemented, the async was not part of the REST API. But as I can read, this seems to be dependent on the media_category.

Please try to set the media_category to amplify_video as followed.

var binary = File.ReadAllBytes("filepath");
var media = Upload.UploadVideo(binary, mediaCategory: "amplify_video");

Then use the Upload.GetMediaStatus to know when the upload has successfully completed.

var status = Upload.GetMediaStatus(media);

if (status.ProcessingInfo.State == "succeeded")
{
    // You can now publish your tweet
}

Documentation : https://github.com/linvi/tweetinvi/wiki/Upload#upload-status-video

Please note that Upload will be slightly improved in the next release of Tweetinvi (1.2).

Regardless of whether this solution works or not please let me know so that I can investigate and fix any potential bug or update the documentation.

Thanks

  • Hi there. Firstly many thanks for building this very useful project. – Doug Rees Oct 18 '16 at 12:10
  • But unfortunately, i already had that setting applied so it does not appear to work. – Doug Rees Oct 18 '16 at 12:10
  • Thanks for the feedback, I will make a request on the Twitter website. – Linvi Oct 18 '16 at 13:02
  • Have you tried with tweet_video as media category? – Linvi Oct 18 '16 at 13:07
  • You can find the post on twitter website here : twittercommunity.com/t/upload-limit-for-video-async/76029 – Linvi Oct 18 '16 at 13:24
0

OK this is my bad. Im really sorry but it appears someone had revoked my API permissions without telling me, but for some reason I wasnt getting the relevant error when I called the upload. It was only when i tried to do a simple Tweetinvi.Account.GetCurrentAccountSettings that i got the relevant error that helped me track it down.

  • Could you please provide more information regarding the media_category you are using? Also, could you please let me know if I can close the twittercommunity ticket? If this question is closed please mark it as resolved ;) – Linvi Oct 19 '16 at 9:09
  • It is resolved. Your code works fine. It was related to someone remove my app's credentials in twitter... – Doug Rees Oct 21 '16 at 10:35

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.