-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Channel custom url unsupported #1
Comments
I tried submitting a feature request to Google to add an additional parameter supporting the custom channel url but was rejected, there also seems to have been a similar request some months before also rejected. It is being rejected because it is "infeasible" which I guess means it would be difficult to implement... and isn't in the roadmap this year. |
I faced a similar problem in my own program, and I gave up parsing the c/channel/user/ input using the youtube api. What I did was given a channel's url, I would go to the videos tab page, go to the first video there, and use the youtube api to get the json data about that channel. Inside that json data is the channel id, which you can use to uniquely identify the channel. This makes it so that the c/channel/user distinction no longer matters, and always return the correct channel. EDIT: Since I just noticed you wrote it in JS, I should mention I wrote this using python using requests and beautifulsoup. I think that JS will also have similar tools to side step this silly issue too. |
The problem with trying to ajax the page content is CORS errors with JS from the browser since its a client side app. I also think it is against terms to query the webpage but not sure about that. |
I've found it is possible to get around the CORS issue by using a proxy such as https://cors.eu.org/ |
Thanks. I used Method 2a "Inspect Element" which worked immediately to add a "/c" channel to YTS. |
I've now replaced resolving for all 3 vanity formats (@, user, custom) to use the innertube resolve_url method which should be much faster and more reliable. /~https://github.com/mattwright324/youtube-api-proxy/blob/main/server.mjs#L78-L93 |
Issue
There exists a custom channel url
youtube.com/c/custom_url
oryoutube.com/custom_url
different from the legacy username urlyoutube.com/user/username
. There is no direct way to query for the custom URL value officially in the YouTube API.Custom URL Resolving
Built into the tool is a custom method to attempt to resolve this URL to the actual channel. It will use the value of the custom channel URL in a
search.list
call filtered to channels, pass those channels to achannels.list
, and try to match the channel propertycustomUrl
to the value in the submitted URL. It will try the first 3 pages (of 50 results per page) before giving up.After finding the channel-id URL, it will replace the input and share-link using the channel-id URL instead. This is so that it does not have to do the resolving every time if the result is shared.
If the resolver could not find anything, it will display an error and link to this issue page.
Manually Resolving
It is possible to manually find the channel id for a custom channel URL if the custom resolver fails to find it.
Method 1: Uploaded Video
This method should always work though it isn't the channel directly. You will get extra detail about the video you selected but the channel details will be listed under the video section.
Method 2a: Inspect Element
This method should always work though if this seems too complicated, try Method 1 instead.
F12
orRight click -> Inspect Element
(Firefox) orRight click -> Inspect
(Chrome)Inspector
tab (Firefox) orElements
tab (Chrome), CTRL+F and search for the stringog:url
. Copy this URL.Method 2b: Console JS
This method should always work though if this seems too complicated, try Method 1 instead.
F12
orRight click -> Inspect Element
(Firefox) orRight click -> Inspect
(Chrome)Console
tab paste the following line and hit enter. Copy the output which will be the channel-id URL.The text was updated successfully, but these errors were encountered: