vimeo / vimeo.py

Official Python library for the Vimeo API.
https://developer.vimeo.com
Apache License 2.0
209 stars 84 forks source link

Transcode status is 'complete' while upload status is 'in_progress' #170

Open dumbeau opened 3 years ago

dumbeau commented 3 years ago

Here is my python console and I'm refreshing the status immediately after upload:

>>> vimUpload = client.upload("testvideo.mp4", data={"name": "Test4"})
>>> vimID = vimUpload.split('/')[2]
>>> json.loads(client.get("https://api.vimeo.com/videos/" + vimID + "?fields=uri,upload.status,transcode.status").text)
{'uri': '/videos/528466234', 'upload': {'status': 'in_progress'}, 'transcode': {'status': 'complete'}}
>>> json.loads(client.get("https://api.vimeo.com/videos/" + vimID + "?fields=uri,upload.status,transcode.status").text)
{'uri': '/videos/528466234', 'upload': {'status': 'in_progress'}, 'transcode': {'status': 'complete'}}
>>> json.loads(client.get("https://api.vimeo.com/videos/" + vimID + "?fields=uri,upload.status,transcode.status").text)
{'uri': '/videos/528466234', 'upload': {'status': 'complete'}, 'transcode': {'status': 'in_progress'}}
>>> json.loads(client.get("https://api.vimeo.com/videos/" + vimID + "?fields=uri,upload.status,transcode.status").text)
{'uri': '/videos/528466234', 'upload': {'status': 'complete'}, 'transcode': {'status': 'in_progress'}}

Having the transcode status set to 'complete' while the video is uploading seems misleading. I would expect something like 'queued', 'waiting', or even 'in_progress' for the transcode status while the video is uploading.

tommypenner commented 3 years ago

Hi @dumbeau this is a known issue on the Vimeo backend, with transcode.status returning complete prematurely.

As a workaround, check the is_playable field from the response instead. This will return false if there are no playable video files yet created, and true when at least one transcode has completed.