Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError: Failed to create an upload ticket #61

Closed
kwikadi opened this issue Jun 12, 2015 · 6 comments
Closed

AssertionError: Failed to create an upload ticket #61

kwikadi opened this issue Jun 12, 2015 · 6 comments
Labels

Comments

@kwikadi
Copy link

kwikadi commented Jun 12, 2015

import vimeo
from configparser import ConfigParser
import os

CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))

config = ConfigParser()
config.read(os.path.join(CURRENT_DIR, 'config.ini'))

token = config['Vimeo']['Access_Token']
key = config['Vimeo']['Client_ID']
secret = config['Vimeo']['Client_Secret']

v = vimeo.VimeoClient(token=token, key=key, secret=secret)

about_me = v.get('/me')

assert about_me.status_code == 200

video_uri = v.upload('vid.mp4')

print(video_uri)

Running this code gives me a traceback:

Traceback (most recent call last):
  File "tester_vimeo.py", line 20, in <module>
    video_uri = v.upload('vid.mp4')
  File "/home/kwikadi/github/venv/lib/python3.4/site-packages/vimeo/upload.py", line 23, in upload
    return self._perform_upload(filename, ticket)
  File "/home/kwikadi/github/venv/lib/python3.4/site-packages/vimeo/upload.py", line 38, in _perform_upload
    assert ticket.status_code == 201, "Failed to create an upload ticket"
AssertionError: Failed to create an upload ticket

I'm using Python 3.4 on Ubuntu 14.04. PyVimeo version 0.3.0

@greedo
Copy link
Contributor

greedo commented Jun 12, 2015

@kwikadi I could not reproduce this error using your environment settings. Could you verify that your token, key and secret are correct?

@greedo greedo self-assigned this Jun 12, 2015
@kwikadi
Copy link
Author

kwikadi commented Jun 13, 2015

I figured that was what

assert about_me.status_code == 200

was for, but I tried

print (about_me.json())

too, and it returns info about my account, so I guess that is ok.
If any confusion still persists, I used the
Client Identifier
Client Secrets
and
Your new Access token
with public private delete upload scopes for the key, secret and token respectively.

@greedo
Copy link
Contributor

greedo commented Jun 17, 2015

@kwikadi sounds like it is not a problem with authentication. Since I will need to dig in a bit further, I would request that you contact us via our help forum.

If you contact us directly through vimeo.com/help/contact and share your exact request with runscope I may be able to help you further. Runscope is 100% free for a single user, making up to 10k requests per month. Or you can share the full error dump you are currently receiving with vimeo.com/help/contact.

@greedo
Copy link
Contributor

greedo commented Jul 6, 2015

@kwikadi by chance did you forget to request upload access?

If so, there's more detailed steps at the top of our new upload documentation: https://developer.vimeo.com/api/upload/videos

@kwikadi
Copy link
Author

kwikadi commented Jul 6, 2015

Oh, I'm sorry, I totally forgot to reply to this. I got an email shortly after saying that access to my app was denied (which is bizarre, but not really something to do with the python API).

Thanks for the help!

@kwikadi kwikadi closed this as completed Jul 6, 2015
@harishtm
Copy link

Hi,

I am getting an error
about_me = v.get('/me')
about_me.json()

JSONDecodeError at /viedo-upload/

Expecting value: line 1 column 1 (char 0)

Could any one help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants