Fetching videos list from a Youtube playlist through RSS doesn't return more than 15 results

久未见 提交于 2019-12-21 04:51:26

问题


I'm using the following API to fetch a list of the videos in a playlist:

https://www.youtube.com/feeds/videos.xml?playlist_id=

The problem is if the playlist has more than 15 videos, the response is only the first 15. I thought there is a paging algorithm, but there is no link rel="next" in the response and appending ?page to the end of the link returns 404.

Thanks


回答1:


First, the YouTube Data API v2 call is already deprecated and encourage you to use the YouTube Data API (v3).

I found in this thread that https://www.youtube.com/feeds/videos.xml?playlist_id=xxxxx is only limited to 15 videos or results.

The old API use max-results and start-index to get more results but it is not working anymore when I try.

If you want more results than 15, I suggest you to use the PlaylistItems: list of the YouTube Data API (v3). It has a parameter maxResults that you can set to maximum of 50. To get the another or next 50 results, you can use the parameter pageToken for it.

Hope this information helps you.



来源:https://stackoverflow.com/questions/42258132/fetching-videos-list-from-a-youtube-playlist-through-rss-doesnt-return-more-tha

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!