如何检索刚上传的视频的 URL?

How can I retrieve the URL of a video I have just uploaded?

我有一个 Python 脚本,可以通过 api 将视频文件推送到我们的 Vimeo 页面,效果很好。我只是无法检索我们刚刚上传的视频的 link。我在示例文档中找到了一个片段,但它似乎不起作用。

import vimeo
import sys

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

# Make the request to the server for the "/me" endpoint.
about_me = client.get("/me")

# Make sure we got back a successful response.
assert about_me.status_code == 200

# Load the body"s JSON data. WORKS UP TO THIS LINE ENABLE BELOW
print (about_me.json())
#sys.exit(0)

# Path to upload file
path_to_file = r"C:\Users\mydocs\Documents\SS19xGEN.mp4"

print('Uploading: %s' % path_to_file)

# Push file with credentials
client.upload(path_to_file, data={'name': 'TEST', 'description': 'test'})

# Return the uri
print("The uri for the video is %s" % (client))

video_data = client.get(client + 'fields=link').json()
print(('"%s" has been uploaded to %s' % (path_to_file, video_data['link'])))

该脚本在最后两行之前运行良好,这是我尝试检索我刚刚在脚本中上传的视频的 URL,但这给了我错误 =“发生异常:类型错误 + 不支持的操作数类型:'VimeoClient' 和 'str'"

我翻阅了文档,但找不到任何示例说明如何执行此操作,对于初学者的问题深表歉意!

根据 docsupload 方法应该 return uri:

# Push file with credentials
video_uri = client.upload(path_to_file, data={'name': 'TEST', 'description': 'test'})

# Return the uri
print("The uri for the video is %s" % (video_uri))

其他方法是使用参数 sortper_page=1

接收视频列表
video_data = client.get('https://api.vimeo.com/me/videos?sort=date&per_page=1').json()    

在url

末尾添加您需要的fields