vimeo / vimeo.py

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

Extracting video url for custom player #144

Closed codingsett closed 5 years ago

codingsett commented 5 years ago

Hello i am trying to extract the direct mp4 video file from my own videos in my PRO account but when i check the json returned by the api there is no such is this possible.

example of what i would like to get: https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4

My code:

videos = v.get('/videos/323111650')

pprint(videos.json())
tommypenner commented 5 years ago

@codingsett Do you get the files array back in the response? Does your auth token have the scope video_files?

codingsett commented 5 years ago

I did not get the files array in the response and where do i add the scope your documentation is not clear enough. This is my full code currently..

v = vimeo.VimeoClient(
    token="xxxxx",
    key="xxxxx",
    secret="xxxx"
)

videos = v.get('/videos/323111650')

pprint(videos.json())
tommypenner commented 5 years ago

How are you generating that token? You specify the video_files scope, along with any other needed scopes, when the token is generated.

https://developer.vimeo.com/api/authentication#understanding-the-auth-process

codingsett commented 5 years ago

Ok i generated the token and specified the scope and added it as an argument when initializing the vimeoclient but i get an error below

token = v.load_client_credentials(scope=['private','public', 'video_files'])

print(token)
{'error': 'You must provide a valid authenticated access token.'}
codingsett commented 5 years ago

Sorted it out