Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 959
Devfly Avatar asked Feb 15 '17 19:02

Devfly


People also ask

Can you get an RSS feed from YouTube?

Just Copy the URL of the Channel From YouTube.com And Paste It Into Your Reader. Or you can just navigate to the channel on the YouTube website, copy the URL, and paste that into your RSS reader. As an example, here is my own YouTube channel URL: This is the same channel ID you'd use above.

What is RSS and how do you use it?

An RSS (Really Simple Syndication) feed is an online file that contains details about every piece of content a site has published. Each time a site publishes a new piece of content, details about that content—including the full-text of the content or a summary, publication date, author, link, etc.

How to create an RSS feed for a YouTube playlist?

Import this file into your favorite RSS feed reader and the content of your favorite channels will be synced directly there. To create a RSS feed for a playlist, you need to know its ID number. You can find it at the end of its URL on YouTube when you visit it on the web.

Why should you use YouTube RSS feeds for your business?

Enabling great features to content creators as well as content viewers. Either to enable integration to websites or just to view videos in people’s favorite feed reader. Also, YouTube RSS feeds can be added to any feed reader or podcast player.

Can fetchrss get a feed from YouTube?

Currently, we can get a feed from a YouTube channel, playlist, and search query. Just in case you didn't know. FetchRSS can parse any web page and convert it to RSS.

How to retrieve playlist videos from YouTube?

To retrieve YouTube Playlist videos, we need API key as well as YouTube Playlist ID. We can find YouTube Playlist Id simply by clicking the Playlist link in YouTube. The URL of that page contains Playlist Id. The following PHP code makes API request to fetch playlist videos from YouTube.


1 Answers

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.

like image 65
KENdi Avatar answered Sep 19 '22 12:09

KENdi