auto-youtube-subscription-playlist-2
auto-youtube-subscription-playlist-2 copied to clipboard
Cannot query for user RedstoneQuarry
I recently added "RedstoneQuarry" to the sheet for this channel: https://www.youtube.com/c/RedstoneQuarry/videos
Since then, it got stuck on that entry with the debug sheet message "Cannot query for user RedstoneQuarry".
When I use "UUW_OAaMdUH3fF00fh8_Koeg" instead, which is the playlist ID of their automatic "all uploads" playlist, that fails with "Cannot query for user UUW_OAaMdUH3fF00fh8_Koeg". Only the channel ID, which is "UCW_OAaMdUH3fF00fh8_Koeg" (C as second character) works, which can apparently only be obtained by saving the HTML source of the channel page and finding the »"externalId":"UCW_OAaMdUH3fF00fh8_Koeg"
« element in some long JSON object (or maybe it's always the playlist ID, but with a C?).
Other short channel URLs, like "slicedlime", "TheHappieCat" or "SiberianHat" work fine.
The same happens for "tryashtar".
It turns out the forUsername
is not for shorter custom urls, it's actually for legacy YT usernames as mentioned here for channels like http://www.youtube.com/user/....
. Therefore, there's no guarantees which ones will have correct results. For now, users will need to find the channel id externally before adding to the sheet instead of the "username".
I don't have a code solution for this problem, but finding the channel ID can be a tad easier.
- click on any of the videos on the channel
- click on the channel name
- the URL now contains the ID instead of the shortname
That doesn't work if they have a custom URL.
The only somewhat solution is mentioned here using search.list, but even that is not 100% reliable.
That doesn't work if they have a custom URL.
Odd. As seen in the screenshot that would be exactly how I get the channel ids from custom URLs, specifically the ones listed in the OP. I just read the "I had to dig into some JSON" and thought there must be an easier way. I'm on Chrome, don't know if that makes a difference.
I agree that we shouldn't over-complicate the script with something that regularly breaks to maybe 30% solve this problem when getting the channel ID by hand and putting it into the spreadsheet 100% solves the issue.
I don't have a code solution for this problem, but finding the channel ID can be a tad easier.
- click on any of the videos on the channel
- click on the channel name
- the URL now contains the ID instead of the shortname
I can attest to this, it works for channels with custom urls too
I don't have a code solution for this problem, but finding the channel ID can be a tad easier.
- click on any of the videos on the channel
- click on the channel name
- the URL now contains the ID instead of the shortname
Maybe this can be linked to in the FAQ?
Thanks for making the gif, added it to the README with https://github.com/Elijas/auto-youtube-subscription-playlist-2/commit/0ca280edd9a81f8974040d578d58ecbb27557273.
The trick to find the channel ID doesn't work anymore for me. I find another way by inspecting the elements but it doesn't work on mobile. Is there another way to find it ?
Interesting that they removed it. Here are two possible solutions:
Solution 1: Search for the custom url in YT Search to get a list of channels, and then check each channel to see if the custom url matches (source: https://gist.github.com/stvar/f57e9792c3dc49fab2690247d6ee74de). This can be implemented within the spreadsheet allowing users to input custom urls too. One disadvantage is if the custom url is too popular in channel name or is not even in the channel name, this method will fail.
Solution 2: The Video api contains channel id so we can create a modal that allows a user to input a video id and get the associated channel id. This method requires more work for both developers and the user but has no failure cases.
It seems like every method gives only the custom URL now. How can new entries be added to the script? I've heard mentions of something in "inspect", but where? My current example: https://www.youtube.com/@CinemaTherapyShow All the methods I've found only return that name, but it doesn't work in the script, neither with or without the @.
My previous comment's two solutions still work, either search for the cannel using Search:list and then verifying the custom url using Channels:list, or by looking up a video using Videos:list and getting the channel id from the response.
I'll probably have time in the coming days to add one or both solutions to the sheet. For now, you can use the Try It! explorer on each page to run queries and get the results.
That gives me error 400 when trying to log in. Good job, Google!
I've added a simple function under the YouTube Controls
custom menu to convert channel name to channel ID in the recent commit. It'll give you URLs to confirm that the channel found is the correct one. Please give it a try.
Somehow I lost my note to look at this again, but randomly remembered it again now. I fed the function various forms of input and it worked for all of them.
Just found a failure case: I had &app=desktop
at the end of the input URL and the new function gave me lots of wrong channels, but not the right one.
Are you putting URLs in the input? You should just be putting the channel name. What’s the input you put, for me to take a look?
Interesting, it does work with most normal URLs. My example was: https://www.youtube.com/@pLOLitik/videos?app=desktop It does work without "?app=desktop".