How get all videos from a playlist using youtube api?(如何使用 youtube api 从播放列表中获取所有视频?)
问题描述
现在我正在使用这个链接
Now i am using this link
http://gdata.youtube.com/feeds/api/playlists/plalistID
从 YouTube 播放列表中检索视频.但问题是只能获得 25 个视频.但播放列表包含 100 个视频.如何从播放列表中获取所有视频?
to retrieve video from YouTube playlist. but the problem is only getting 25 video. but the playlist contains 100 videos. How get all video from playlist?
推荐答案
Youtube 让您可以为每个请求获取多达 50 个条目.
响应包含一些 元素.如果还有更多记录要获取其中之一,则格式为
<link rel='next' ...
例如
Youtube let's you fetch up to 50 entries per request.
The response contains some <link>
elements. And if there are still more records to fetch one of it is of the form <link rel='next' ...
e.g.
<link
rel='next'
type='application/atom+xml'
href='https://gdata.youtube.com/feeds/api/playlists/plalistID?start-index=26&max-results=25&v=2'
/>
搜索此元素并检索 href 属性指向的文档,直到响应没有 <link rel='next'
元素.
Search for this element and retrieve the document that the href attribute points to until the repsonse has no <link rel='next'
element.
这篇关于如何使用 youtube api 从播放列表中获取所有视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用 youtube api 从播放列表中获取所有视频?


- 使用 GD 和 libjpeg 支持编译 PHP 2022-01-01
- 如何使用 Google API 在团队云端硬盘中创建文件夹? 2022-01-01
- openssl_digest vs hash vs hash_hmac?盐与盐的区别HMAC? 2022-01-01
- 如何在 Symfony2 中正确使用 webSockets 2021-01-01
- Laravel 5:Model.php 中的 MassAssignmentException 2021-01-01
- 如何从数据库中获取数据以在 laravel 中查看页面? 2022-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 覆盖 Magento 社区模块控制器的问题 2022-01-01
- PHP foreach() 与数组中的数组? 2022-01-01
- PHP - if 语句中的倒序 2021-01-01