37 Comments

thanks mate. been looking to do something like this for quite some time. you saved me the hassle of doing it myself. I tweaked it just a tad though. I added a PlayList ID in Column E so I can add videos to separate playlists and I reversed the order of which it checks videos:

for(var j=maxVideosToCheck-1;j>=0;j--)

So it adds them in chronological order (important for some channels). This makes the third page add videos much faster than intended and also makes lastVideoID much less useful. But it's manageable for now.

I really appreciate it.

Expand full comment
Aug 19, 2023Liked by Chirav

Thank you, Tech angel!

Expand full comment

A bit late to the party - this is excellent!

Is there a way to have the script auto edit both the ID's from an additional sheet so you could have a multiple playlists updating from the one document. Great Work and thanks for sharing... Toolmaker / coding noob / x-UI/UX Designer. Manolo

Expand full comment
Mar 9·edited Mar 9

Just checking in if this still works as of March 9th 2024? I have it all setup and it seems to be partially working, that is it added a few videos to the playlist I setup from the channels I added to the google sheet, but only videos from 3 channels of the 18? Its running with no errors output to me. Also is there anyway to stop it from adding youtube shorts?

Expand full comment
Jan 16·edited Jan 16

Hi! Thanks for making this. I’ve been getting the following error when running the script:

TypeError: Cannot read properties of undefined (reading ‘id’) at myFunction(Code:59:67)

I’ve edited spreadsheetID, playlistID, and maxVideosToCheck (set to 300, which is high, but I wanted to add a large backlog to my playlist). Would really appreciate if you could point me toward what might be causing the error.

Expand full comment

This is awesome, thank you! Is there a way to find out what are daily quota is. Right now if I exceed it I just get an email telling me that, but no way of knowing how much I need to cut back. Thanks!

Expand full comment

Hello, just wonder is this app still working in 2023, because when i input the channel id name, the name and last video id didn't update automatically... :(

Expand full comment

Hi, is there anyway to automatically or manually remove watched videos in bulk?

Expand full comment

7:24:52 PM Error

GoogleJsonResponseException: API call to youtube.search.list failed with error: The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.

myFunction @ Code.gs:51

Expand full comment

Any chance you could update this to include a filter for keywords? I do want to watch videos with a certain title that regularly get uploaded, like "a closer look" with seth myers, but I don't care about the celebrety interviews and stuff. An extra column in the google sheet where you could enter keywords so only videos matching them get added would be awesome. I tried looking into how to do this myself, but I suck a programming :)

Expand full comment

I'm confused on how many videos can be added at a time based off the quotas, I listen to a lot of new music, I usually manually add 500ish videos and subscribe to about 500 channels, if I run it manually once a day. Will the quotas be a problem to even be worth to set up the script?

Expand full comment
Jan 19, 2022·edited Jan 19, 2022

Hey, I hope you're still watching the comment section here because i got an error. I’m not a programmer, so I don't know what it means and how i can fix it. It is the following

GoogleJsonResponseException: API call to youtube.search.list failed with error: The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.

The error seems to occur at Line 51 according to Google App Script

Expand full comment

This seems not to work when using a Brand Account with YouTube. The videos don't get added to the new playlist: "GoogleJsonResponseException: API call to youtube.playlistItems.insert failed with error: Forbidden"

Expand full comment

You can export and add all your subscriptions at once with these steps:

1. Make sure you are logged in with the Google account you use for Youtube

2. Go to https://takeout.google.com/takeout/custom/youtube

3. Click on the button "All YouTube data included"

4. Selec only subscriptions and click "OK"

5. Click "Next step"

6. Click "Create export"

7. Once the download is ready, click it

8. In the ZIP file you'll find a JSON file, open it with excel or similar

9. Copy the first column to your google sheet

Expand full comment

hey... thanks for the post.. it worked fine when I used the copy of your google sheet.. however it is not adding videos to my playlist when i try to edit or add channel ID... is there a special way to do that?? I simply "paste as text only" the channel id below the 4 channels you provided

P.s. - it recognizes the new channel name and last video id correctly.. it just doesn't add to watched videos sheet and neither to my actual playlist...

Expand full comment

Hey, thanks for the script ! I was looking for this !

I followed the tutorial to update it with my own ID (spreadsheet, playlist and channel)

I always encounter errors on the lines "YouTube.Search.list"

I wrote myself "Channel Name" and "lastVideoId" to bypass first errors (lines 24 and 37) but i still get error on line 51.

Error is :

"GoogleJsonResponseException: API call to youtube.search.list failed with error: Request contains an invalid argument.

myFunction @ Code.gs:51"

I updated only the var "spreadsheetID" and "playlistID"

Do you have any idea what's the problem, i'm not used to GoogleScript/JS i don't really know what's the problem there.

Expand full comment