vimeo / vimeo.py

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

Failed upload using Device Auth token #171

Closed marcelcs closed 3 years ago

marcelcs commented 3 years ago

Hello! I'm trying to put together a simple Proof of Concept of an application that eventually posts the user's video to their own account.

In my own account I created an App. I then followed steps described in https://developer.vimeo.com/api/authentication to acquire the Device Code Grant kind of Auth Token from a second account. I managed to get said token with no problem.

However, I'm having trouble using said token. Here's the script to upload a file to this second account:

file_name = 'path/to/file'
client = vimeo.VimeoClient("<TOKEN_FROM_CODE_GRANT>")

uri = client.upload(file_name, data={
  'name': 'Test',
  'description': 'Description of the video goes here.',
})

I also tried providing the app's key and secret alongside the second account's token, but I run into the exact same error message... And I'm not sure what is going on.

And when I try to run this simple script, I get a permission (?) error: vimeo.exceptions.UploadAttemptCreationFailure: This app cannot generate a token with the upload scope for the requested account. This app can only upload to the app owner's account.

Can someone please clarify how to properly use this token I got from the Device Code Grant procedure?

jaylinski commented 3 years ago

When you are receiving the OAuth response you should see your granted scopes:

https://developer.vimeo.com/api/authentication#using-the-device-code-grant-step-5

Does it contain the upload grant?

tommypenner commented 3 years ago

Hi @marcelcs, that app is only approved for uploading to its own Vimeo account. The app cannot be used to upload videos to another user's account.

To request permission, reach out to Vimeo Support here: https://vimeo.com/help/contact

(Also, when you receive a ticket number, provide that ticket number here and Vimeo Staff can expedite the request)

marcelcs commented 3 years ago

@jaylinski From the response to /oauth/device/authorize "scope": "upload private public",

marcelcs commented 3 years ago

@tommypenner thank you! This is the ticket number: #7865491