TaskPlays
TaskPlays

Reputation: 31

YouTube: get number of watch later items

I'm building a dashboard (in php) for all of my relevant data and I also want to display the number of my items in the YouTube "watch later" playlist.

I know there is no way to use the YouTube API for this but maybe there is someone with an idea for a workaround?

Upvotes: 0

Views: 73

Answers (1)

Martijn
Martijn

Reputation: 417

Depending on your servers support for cross-platform support and the Youtube terms of service, you could write an effective data scraper in PHP. At least their robots.txt seems to allow for you to request Watch Later (which was surprisingly difficult to find by itself).

This page then has a field

<yt-formatted-string class="style-scope ytd-playlist-sidebar-primary-info-renderer">
    655 videos
</yt-formatted-string>

which you can let the code read. While you're at it, you might even want to add the first few entries to your dashboard too.

Upvotes: 1

Related Questions