youtube-metadata icon indicating copy to clipboard operation
youtube-metadata copied to clipboard

Channel custom url unsupported

Open mattwright324 opened this issue 5 years ago • 5 comments

Issue

There exists a custom channel url youtube.com/c/custom_url or youtube.com/custom_url different from the legacy username url youtube.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 a channels.list, and try to match the channel property customUrl 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.

  1. Navigate to the channel with the custom channel URL in your browser. Such as https://www.youtube.com/c/creatoracademy
  2. Click on a public video uploaded by that user and copy the video url. Such as https://www.youtube.com/watch?v=OrzMIhLpVps
  3. Paste the video URL into YouTube Metadata and submit.

Method 2a: Inspect Element

This method should always work though if this seems too complicated, try Method 1 instead.

  1. Navigate to the channel with the custom channel URL in your browser. Such as https://www.youtube.com/c/creatoracademy
  2. Open your browser developer tools with F12 or Right click -> Inspect Element (Firefox) or Right click -> Inspect (Chrome)
  3. In the Inspector tab (Firefox) or Elements tab (Chrome), CTRL+F and search for the string og:url. Copy this URL.
  4. Paste the channel-id URL into YouTube Metadata and submit.

Method 2b: Console JS

This method should always work though if this seems too complicated, try Method 1 instead.

  1. Navigate to the channel with the custom channel URL in your browser. Such as https://www.youtube.com/c/creatoracademy
  2. Open your browser developer tools with F12 or Right click -> Inspect Element (Firefox) or Right click -> Inspect (Chrome)
  3. In the Console tab paste the following line and hit enter. Copy the output which will be the channel-id URL.
document.querySelector("meta[property='og:url']").content
  1. Paste the channel-id URL into YouTube Metadata and submit.

mattwright324 avatar Sep 07 '20 20:09 mattwright324

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.

  • https://issuetracker.google.com/issues/174903934
  • https://issuetracker.google.com/issues/165676622

mattwright324 avatar Dec 08 '20 18:12 mattwright324

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.

staedtlernorica avatar Feb 12 '21 20:02 staedtlernorica

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.

mattwright324 avatar Feb 13 '21 21:02 mattwright324

I've found it is possible to get around the CORS issue by using a proxy such as https://cors.eu.org/

mattwright324 avatar Jan 02 '22 04:01 mattwright324

Thanks. I used Method 2a "Inspect Element" which worked immediately to add a "/c" channel to YTS.

Papoulka avatar Aug 18 '22 01:08 Papoulka