0

I am trying vimeo API using python in a jupyter notebook.

I want to access the links of videos located inside subfolders of a parent folder.

I can get the links of all my videos with GET /me/videos?fields=link... but if I try setting the parent folder in the uri I don't get any video (since in that folder there are none)

I know I can use "include_subfolders" with the query parameter (or if I had a tag...), but I want all the results, not to query by any particular word. I have tried querying a letter and I get some of the videos, but never all of them, and that cannot be the best solution.

Is there a way to query ALL videos inside all subfolders? I have tried with "",*, ...nothing seems to work.

Another possible solution I have thought of would be to search all the videos and filter by parent folder. With the metadata.connections.ancestor_path I get an array that I could later manipulate... but I have too many videos and I don't want them all at once, I want to get the links by folders, if possible.

Things I tried but didn't work: In a folder with 8 subfolders and 30 video links I tried with items :

uri='https://api.vimeo.com/users/123456789/projects/3213121/items'
video_data = client.get(uri + '?fields=created_time,name,link,duration&sort=date&per_page=100&page=1').json()

Result:

{'total': 8, 'page': 1, 'per_page': 100, 'paging': {'next': None, 'previous': None, 'first': '/users/123456789/projects/3213121/items?fields=created_time%2Cname%2Clink%2Cduration&sort=date&per_page=100&page=1', 'last': '/users/123456789/projects/3213121/items?fields=created_time%2Cname%2Clink%2Cduration&sort=date&per_page=100&page=1'}, 'data': [[], [], [], [], [], [], [], []]}

Example of a query including subfolders, instead of a word, by letter:

#parent folder: 
uri="https://api.vimeo.com/me/projects/12345678/videos" 
video_data = client.get(uri + '?fields=created_time,name,link,duration&sort=date&per_page=100&page=1&query=A&include_subfolders=true').json()

Result: (not all the links I wanted, but some, so it should not be a problem of permisions or privacy...)

{'total': 12, 'page': 1, 'per_page': 100, 'paging': {'next': None, 'previous': None, 'first': '/me/folders/5745971/videos?fields=created_time%2Cname%2Clink%2Cduration&sort=date&per_page=100&page=1&query=A&include_subfolders=true', 'last': '/me/folders/12345678/videos?fields=created_time%2Cname%2Clink%2Cduration&sort=date&per_page=100&page=1&query=A&include_subfolders=true'}, 'data': [{'name': 'Circuito a TV', 'link': 'https://vimeo.com/12345678', 'duration': 520, 'created_time': '2021-09-22T21:38:04+00:00'}, {'name': '3 TV a Álgebra', 'link': 'https://vimeo.com/12345678', 'duration': 338, 'created_time': '2021-09-22T11:07:06+00:00'}, {'name': '2 Circuito a Álgebra', 'link': 'https://vimeo.com/12345678', 'duration': 681, 'created_time': '2021-09-22T11:06:04+00:00'}, {'name': '5 Álgebra a circuito', 'link': 'https://vimeo.com/12345678', 'duration': 267, 'created_time': '2021-09-22T11:11:34+00:00'} 

This is my first question and I have searched but haven't found any question already talking about this exact issue, hope I made myself more or less clear.

melguinha
  • 1
  • 1

0 Answers0