1

I am trying to upload video on Vimeo with Vimeo Android API and tus library. I have upload access, I have PRO account, and I follow this tutorial (https://developer.vimeo.com/api/upload/videos). After I get upload_link from Vimeo, I tried to start video upload, so I select .mp4 file from storage, passed upload_link as link of beginOrResumeUploadFromURL function from TusClient, and get error:

io.tus.java.client.ProtocolException: unexpected status code (404) while resuming upload.

I tried to contact vimeo but they do not reply to my mail with the details of the request. Also, I added headers to my tus request:

   `headers.put("Tus-Resumable", "1.0.0");
    headers.put("Authorization", getBasicAuthHeader());
    headers.put("Accept", getAcceptHeader());
    headers.put("Content-Type", "application/offset+octet-stream");
    headers.put("Upload-Offset", "0");
    headers.put("Upload-Length", "" + bytes.length);
    headers.put("X-HTTP-Method-Override", "PATCH");`

upload_link has next form: https://1515143793.cloud.vimeo.com/upload?ticket_id=323834021&video_file_id=1807184661&signature=some_number&v6=1&redirect_url=https%3A%2F%2Fvimeo.com%2Fupload%2Fapi%3Fvideo_file_id%some_number%26app_id%some_number%26ticket_id%some_number%26signature%some_number

Setup details:

  • Runtime environment: [Android 7.0]
  • Used tus-android-client version: [e.g. v0.1.9]
  • Used tus-java-client version: [e.g. v0.4.1]
  • Used tus server software: [1.0.0]

2 Answers2

0

That upload_link is not one for Vimeo's tus upload system. Possibly you didn't use "approach": "tus" when creating the upload. The upload_link you get back should point to one of the tus.vimeo.com endpoints (e.g. us-files.tus.vimeo.com).

  • and @TommyPenner I found a problem and a solution. The latest Vimeo Android lib use version `3.2` instead of `3.4`, so it put `application/vnd.vimeo.*+json;version=3.2` instead of `application/vnd.vimeo.*+json;version=3.4` as the `Accept` header value. Now I have new problem, my upload stuck after a few seconds without giving me any error. Somethimes I get `javax.net.ssl.SSLException: Write error: ssl=0xc74a7538: I/O error during system call, Connection timed out` Thank you guys so much for helping me! – Petar LjubicOfficial May 18 '20 at 07:05
0

The upload_link being returned is invalid for tus upload. The initial POST /me/videos request must be malformed in some way; you can verify this by making sure the response returns upload.approach=tus, or by checking that the upload_link returned is on the files.tus.vimeo.com host (though that may change at any time -- verifying upload.approach is recommended).

This previous response should help guide you in the right direction: https://stackoverflow.com/a/57312245/3704546

Tommy Penner
  • 2,910
  • 1
  • 11
  • 16