以编程方式获取私有 Vimeo 视频的 URL/嵌入代码 [英] Get URL/Embed code to private Vimeo videos programatically

查看:34
本文介绍了以编程方式获取私有 Vimeo 视频的 URL/嵌入代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们一直是 Vimeo PRO 的长期用户,我们用它来托管在多个网站上显示的视频.这些视频设置为私有,因此无法在 Vimeo 的公共部分中找到.到目前为止,每当我们需要显示视频时,我们要么从 Vimeo 获取嵌入代码,要么复制直接链接"(即 http://player.vimeo.com/external/1234567890.hd.mp4?s=nskljdfnsdlkn3498hnc3h49fo83h4oif3) 转换为所需质量的视频文件并将其加载到第三方播放器上.这样做完全没有问题.

We've been long time users of Vimeo PRO, we use it to host our videos that are shown in multiple websites. Those videos are set to private, so they can't be found in the public part of Vimeo. Until now, whenever we needed to show a video, we would either get the embed code from Vimeo or copy the "direct link" (i.e. http://player.vimeo.com/external/1234567890.hd.mp4?s=nskljdfnsdlkn3498hnc3h49fo83h4oif3) to the video file of the desired quality and load it on a third party player. No issues at all doing all this.

现在我们要开始处理更多的视频,所以我一直在寻找一种方法来自动化获取这些嵌入代码或直接链接的过程.看起来要走的路是使用 Vimeo API.

Now we're going to start handling a lot more videos, so I've been looking at a way of automatizing the process of obtaining those embed codes or direct links. Looks like the way to go is by using the Vimeo API.

然而,我已经开始研究它,但我很困惑.它讨论了注册应用、在用户请求访问时授予用户权限,以及其他对于我真正需要的东西来说似乎有点矫枉过正的事情.

However, I've started looking into it and I'm pretty confused. It talks about registering apps, give users permissions when they request access, and other things that seem an overkill for what I really need.

我们没有要注册的应用程序或多个用户授予访问权限,我们只有 Vimeo 用户名/密码,我们的想法是编写一个函数,该函数可用于不同的网站以请求视频 URL 或其嵌入代码基于它的 Vimeo ID.

We have no apps to register or multiple users to grant access, we just have our Vimeo username/password and the idea is to code a function that can be used in different websites to request a video URL or its embed code based on its Vimeo ID.

我找错地方了吗?如果没有,我应该注册什么应用程序"?每个网站都将使用 Vimeo 的视频?(我们有几十个)

Am I looking in the wrong place? If not, what "app" should I register? Every single website that's going to use a video from Vimeo? (we have dozens)

如果 Vimeo API 是唯一的出路,有人可以链接到一个尽可能简单的示例来满足我们的需要吗?

If the Vimeo API is the only way to go, could someone link to an example as simple as possible for the kind of usage we need?

谢谢!

推荐答案

Vimeo API 是适合使用的系统,我将简要描述什么最适合您所描述的工作流程.

The Vimeo API is the right system to use, and I'll describe briefly what will work best for your described workflow.

  1. https://developer.vimeo.com/apps
  2. 上注册 API 应用
  1. Register an API app on https://developer.vimeo.com/apps

这对于每个 API 应用都是必要的.我们需要知道谁在使用我们的系统,以及在必要时如何联系他们.

This is necessary for every API app. We need to know who is using our system, and how to contact them if necessary.

  1. 生成访问令牌.

https://developer.vimeo.com/api/authentication 上有一般文档,但您可能会使用单用户应用程序"工作流程.这是通过应用程序页面上的 UI 生成访问令牌,然后将其硬编码到您的应用程序中"的崇高标题.此访问令牌将代表注册应用程序的用户与 API 交互.

There is general documentation at https://developer.vimeo.com/api/authentication, but you will likely be using the "single user application" workflow. It's a lofty title for "generate an access token via the UI on your application page, then hard code it into your app". This access token will interact with the API on behalf of the user who registered the application.

  1. 请求您的视频信息.

有许多不同的 API 调用来获取视频信息.您可以在 https://developer.vimeo.com/api/endpoints 上找到这些内容./me/videos 将显示所有经过身份验证的用户视频,/videos/{video_id} 将显示单个视频.

There are many different API calls to get video information. You can find these at https://developer.vimeo.com/api/endpoints. /me/videos will show all of the authenticated users videos, /videos/{video_id} will show a single video.

这篇关于以编程方式获取私有 Vimeo 视频的 URL/嵌入代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆