Subplayo
Google Apps Script that automatically adds newly published YouTube videos from selected channels to your playlists.
AI Summary
Subplayo
A Google Apps Script that automatically adds the latest videos from specified YouTube channels to your playlists.
Target Users
Intermediate Google Apps Script users who want to automate YouTube playlist curation for personal or team video libraries.
Problems Solved
Manually checking multiple channels for new videos and avoiding duplicates when adding them to playlists is time-consuming and error-prone.
Tags
Main Features
Automatic detection and addition of new videos
Uses YouTube Data API v3 to fetch each channel’s newest video and add it to the designated playlist in a single function call.
Duplicate prevention
Stores last-added video IDs and skips items already present in the playlist to prevent duplicates.
Fully server-less within Google
Runs entirely inside Google Apps Script, eliminating the need for external servers and keeping all user data within the Google account.
Time-driven trigger support
Supports Apps Script time-driven triggers so playlists stay updated hourly or at any chosen interval.
Usage Examples
Minimal example: add newest videos to a playlist
/**
* Register your playlist ID and channel IDs in Settings.gs
*/
const settings = {
playlists: {
// targetPlaylistId : [channelId, ...]
"PLxxxxxxxxxxxxxxxx": [ // e.g. Tech playlist
"UCaaaaaaaaaaaaaaaa", // Channel A
"UCbbbbbbbbbbbbbbbb" // Channel B
],
}
};
/**
* Wrapper for manual testing.
* Simply calls the main function included in Subplayo.
*/
function runOnce() {
addNewVideosToPlaylists(); // Automatically adds the latest videos
}Define your playlists and channels in the settings object, run runOnce(), and the latest videos are added. Attach a time-driven trigger to automate the process.