-
Notifications
You must be signed in to change notification settings - Fork 5
YouTube Playlists
Will never improve beyond their current support as RTV-formatted playlists.
However, there is good news! Tools are very slowly trickling out to accommodate various users converting YouTube playlists (their own or otherwise) to RTV playlists.
Look here for playlist generation and conversion tools for several methods on how to get a proper playlist and then add it to RTV as a custom channel.
There are two primary options:
-
Load the playlist page/HTML with AJAX and parse (100% Client side)
- ๐ Simple, in implementation and production.
- ๐ Instantly shot down by CORS.
- ๐ Primarily limited to 100 items
- Unless the remaining AJAX response is also fetched
-
Use the YouTube API (v3) "as intended" (Client side + Developer API key)
- ๐ Clean, reliable/consistent.
- ๐ No difficulty with playlist lengths, infinite items.
- ๐ Revolves around a pre-determined, but "generous", quota. (example below)
- ๐ Very slow due to all the pre-processing before RTV can even begin its processing.
Assume a quota limit of 1,000,000 units
, per day, per API key and a playlist with 173 items.
- First, to fetch a playlist is
1 unit
per call.- Can only return 50 items ("page") max per call, so 4 calls. (
4 units
) - Including the video IDs is
0 units
, each. - There's also waiting time between each to wait for it to complete and indicate the next "page" to request.
- End of this step is
4 units
.
- Can only return 50 items ("page") max per call, so 4 calls. (
- Strip out all the video IDs into a new playlist.
- Fetch the per-video information.
- Can only return 50 items ("page") max per call, so 4 calls. (
4 units
total) - The information we need (duration) is
2 units
, per video. (346 units
total) - End of this step is
350 units
.
- Can only return 50 items ("page") max per call, so 4 calls. (
- In total, a 173 item playlist would cost approximately
354
of1 million
units.- Caching could help reduce repeats, but only so much.
While it's a drop in the bucket, it's an enforced limit I'm not happy with enabling. RTV is intended to be client-side, and while it would still be, would be passing through a "third-party" (my developer API key).