auto-youtube-subscription-playlist-2 icon indicating copy to clipboard operation
auto-youtube-subscription-playlist-2 copied to clipboard

Cannot query for user RedstoneQuarry

Open Fabian42 opened this issue 4 years ago • 19 comments

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.

Fabian42 avatar Nov 04 '20 10:11 Fabian42

The same happens for "tryashtar".

Fabian42 avatar Nov 16 '20 15:11 Fabian42

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".

victorjzsun avatar Nov 17 '20 03:11 victorjzsun

I don't have a code solution for this problem, but finding the channel ID can be a tad easier.

  1. click on any of the videos on the channel
  2. click on the channel name
  3. the URL now contains the ID instead of the shortname

image

JesperDramsch avatar Dec 19 '20 15:12 JesperDramsch

That doesn't work if they have a custom URL.

Fabian42 avatar Dec 19 '20 18:12 Fabian42

The only somewhat solution is mentioned here using search.list, but even that is not 100% reliable.

victorjzsun avatar Dec 19 '20 18:12 victorjzsun

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.

JesperDramsch avatar Dec 21 '20 15:12 JesperDramsch

I don't have a code solution for this problem, but finding the channel ID can be a tad easier.

  1. click on any of the videos on the channel
  2. click on the channel name
  3. the URL now contains the ID instead of the shortname

image

I can attest to this, it works for channels with custom urls too

victorjzsun avatar Dec 22 '20 00:12 victorjzsun

I don't have a code solution for this problem, but finding the channel ID can be a tad easier.

  1. click on any of the videos on the channel
  2. click on the channel name
  3. the URL now contains the ID instead of the shortname

Maybe this can be linked to in the FAQ?

get_url_when_custom

JesperDramsch avatar Dec 22 '20 16:12 JesperDramsch

Thanks for making the gif, added it to the README with https://github.com/Elijas/auto-youtube-subscription-playlist-2/commit/0ca280edd9a81f8974040d578d58ecbb27557273.

victorjzsun avatar Mar 07 '21 18:03 victorjzsun

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 ?

EmiLuna avatar Jun 17 '22 08:06 EmiLuna

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.

victorjzsun avatar Jun 19 '22 20:06 victorjzsun

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 @.

Fabian42 avatar May 21 '23 12:05 Fabian42

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.

victorjzsun avatar May 23 '23 01:05 victorjzsun

That gives me error 400 when trying to log in. Good job, Google!

Fabian42 avatar May 23 '23 13:05 Fabian42

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.

victorjzsun avatar Jul 03 '23 23:07 victorjzsun

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.

Fabian42 avatar Jul 18 '23 05:07 Fabian42

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.

Fabian42 avatar Oct 06 '23 01:10 Fabian42

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?

victorjzsun avatar Oct 06 '23 05:10 victorjzsun

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".

Fabian42 avatar Oct 06 '23 05:10 Fabian42