搜索查询如何与 Vimeo API 一起用于我的视频 (/me/videos)? [英] How does the search query work with Vimeo API for my videos (/me/videos)?

查看:33
本文介绍了搜索查询如何与 Vimeo API 一起用于我的视频 (/me/videos)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说明

我正在尝试通过 Vimeo API 了解搜索查询"是如何工作的.我什至通过他们在 Vimeo API 上为开发人员提供的Vimeo 上的操场截图.正如您所看到的,查询接受一个字符串",但没有说明它是如何工作的.

我正在尝试通过我放在标题中的关键字来查找视频.我已经使用 Playground 来测试并查看查询的实际工作方式.

我的尝试

用 NOTHING 填写上图中的查询"文本框会返回 2 个结果.

<代码>{总计":2,/* 其余数据在这里 */}

这是意料之中的,因为到目前为止我只上传了两个视频.

我试图在查询中输入 标题 中的一个词,但它们总是返回 0 个结果.

这是我使用的 PHP 代码,当然返回 0 个结果.

公共函数 findVimeoVideoByKeyword($keyword) {$response = $this->lib->request('/me/videos', ['查询' =>$关键字]);# 在这里处理响应代码...}

这是我在标题中搜索特定单词时转储的返回数据(0 个结果):

VimeoService.php 第 168 行:数组:3 [▼身体" =>数组:5 [▼总计"=>0//0 个结果页面" =>1每页" =>25分页" =>数组:4 [▶]数据" =>[]]状态" =>200标题" =>数组:20 [▶]]

这是当我不搜索任何东西时返回的数据(3 个结果):

VimeoService.php 第 167 行:数组:3 [▼身体" =>数组:5 [▼总计"=>3//3 结果页面" =>1每页" =>25分页" =>数组:4 [▶]数据" =>数组:3 [▶]]状态" =>200标题" =>数组:21 [▶]]

通过使用 FULL 标题查询搜索视频返回 0 个结果.

问题

如何使用 Vimeo API 正确使用查询"属性根据标题搜索特定视频?

解决方案

我继续问了同样的问题 问题在 VIMEO 论坛上,并得到了其中一位开发人员的快速回复.

<块引用>

当查询/me/videos 时,只有 vimeo.com 上公开的视频被退回.私人视频不会在搜索中编入索引,也不会执行搜索查询时返回.

我原本以为这仅适用于 /videos 而不适用于 /me/videos

显然,搜索查询还有另一种方法可以处理私人视频.

<块引用>

尚未实施.我们确实有一个解决方法,如果您启用您的 PRO 帐户上的私人模式,然后您可以在您的帐户上查询视频帐户.否则表演时私人视频不可用搜索查询.

关键是将 PRO 帐户置于私人模式,这样您就可以查询该帐户上的视频.

我已经测试过了.所需要做的就是通过以下方式设置私密模式:帐户设置 -> 常规 -> 私密模式 -> 启用然后它将您的帐户设置为私人模式并将您的所有视频设为私人.搜索查询然后工作.

Description

I'm trying to understand how the "search query" via Vimeo API works. I've even tried it out via their "playground" on Vimeo API for developers.

Screenshot of the playground on Vimeo. As you can see the query takes in a "string" but there is not description on how it works.

I'm attempting to find a video via the a keyword that I put in the title. I've used the playground to test and see how the query actually works.

What I've tried

Filling out the "query" text box in the image above with NOTHING returns 2 results.

{
    "total": 2,
    /* Rest of data here */
}

This is expected because I've only uploaded two videos so far.

I've attempted to put a word from the title in the query but they always return 0 results.

Here is the PHP code I'm using, which of course returns 0 results.

public function findVimeoVideoByKeyword($keyword) {
    $response = $this->lib->request('/me/videos', [
        'query' => $keyword
    ]);

    # handle response code here...
}

This is the return data that I've dumped when searching for a specific word in a title (0 results):

VimeoService.php on line 168:
array:3 [▼
  "body" => array:5 [▼
    "total" => 0 //0 results
    "page" => 1
    "per_page" => 25
    "paging" => array:4 [▶]
    "data" => []
  ]
  "status" => 200
  "headers" => array:20 [▶]
]

This is the data returned when I do not search for anything (3 results):

VimeoService.php on line 167:
array:3 [▼
  "body" => array:5 [▼
    "total" => 3 //3 results
    "page" => 1
    "per_page" => 25
    "paging" => array:4 [▶]
    "data" => array:3 [▶]
  ]
  "status" => 200
  "headers" => array:21 [▶]
]

Searching for a video by querying with the FULL title returns 0 results.

Question

How do I correctly use the "query" property to search for specific videos according to their title with Vimeo API ?

解决方案

I went ahead and asked the same question on the VIMEO forums, and got a quick response from one of the devs.

When querying /me/videos only videos publicly available on vimeo.com are returned. Private videos are not indexed in search, and will not return when performing search queries.

I had originally thought that this was only for /videos and not for /me/videos

Apparently there is another approach for the search query to work on private videos.

Not yet implemented. We do have a workaround where if you enable Private Mode on your PRO account, you can then query videos on your account. Otherwise private videos are not available when performing search queries.

The key would be to put the PRO account in private mode which enables you to query videos on the account.

I have tested this. All that there is required to do is to set private mode by: Account Settings -> General -> Private Mode -> Enable It will then set your account to Private Mode and put all your videos as Private. The Search Query then works.

这篇关于搜索查询如何与 Vimeo API 一起用于我的视频 (/me/videos)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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