Elijas / auto-youtube-subscription-playlist-2

Script automatically adds videos to playlists from Youtube channels and/or subscriptions (Youtube Collections alternative).
MIT License
246 stars 54 forks source link

Fails forever after channel deleted #109

Open Fabian42 opened 2 years ago

Fabian42 commented 2 years ago

This channel has been deleted due to copyright issues: https://www.youtube.com/channel/UCntTdnZ7jIGvsii78t-UClg

It was in my sheet and since then, that row stopped updating and the debug output is always:

YouTube channel search returned invalid response for channel with id UCntTdnZ7jIGvsii78t-UClg

Is this differentiable from a channel that never existed (because the user just inserted the wrong text)? If no, should this be fixed? That would mean hiding the issue, so the user might not notice that they're not getting new videos from whatever they're actually tried to insert into the sheet.

victorjzsun commented 2 years ago

In response to your question, no there is no difference between a deleted channel and one that doesn't exist. IMO it's better to error out and tell the user that the channel cannot be found rather than hide the issue.

One interesting thing though is that the script's error was supposed to say "Cannot find channel with id ". I check to see how many items are in the response and based on that, I choose which error to print to the user, the one you wrote or this one. For YT.Channels.List, an invalid channel id returns a response object with no items array while other List APIs either return an empty items array or throw error. Therefore, I changed the script to use the correct error if it cannot find the channel with that id so I hope that's descriptive enough for the user to investigate it themselves.

victorjzsun commented 1 year ago

Fixed the error handling for this in the newest release, let me know if you still have concerns about anything