YouTube.js icon indicating copy to clipboard operation
YouTube.js copied to clipboard

Get Channel ID by Custom URL

Open OskarEichler opened this issue 3 years ago • 3 comments

Describe your suggestion

Hey @LuanRT ,

As far as I'm aware it is currently not possible to grab channel information via the API using the custom URL of a channel.

The new custom URLs in the /c/xxxxx format are not supported. This is really frustrating, as often we rely on users to paste in their channel URL but we can't parse it correctly if they use the custom URL, and they have a hard time finding their Channel ID as the browser always redirects to the custom url.

Here is an example: https://www.youtube.com/c/WINKEDRecords

Is there some endpoint that can resolve the custom URL and return the channel ID so that we can fetch data correctly?

All the best, Oskar

Other details

No response

Checklist

  • [X] I am running the latest version.
  • [X] I checked the documentation and found no answer.
  • [X] I have searched the existing issues and made sure this is not a duplicate.
  • [X] I have provided sufficient information.

OskarEichler avatar Jul 25 '22 06:07 OskarEichler

Yup, some time ago I found the endpoint /navigation/resolve_url in the Android client. And it does exactly what you said.

Ex;

curl --request POST \
  --url 'https://youtubei.googleapis.com/youtubei/v1/navigation/resolve_url?key=AIzaSyDCU8hByM-4DrUqRUYnGn-3llEO78bcxq8' \
  --header 'Content-Type: application/json' \
  --data '{
    "context": {
        "client": {
            "clientName": "ANDROID",
            "clientVersion": "17.29.33",
            "hl": "en"
        }
    }, 
    "url": "https://youtube.com/c/macmiller"
  }'

LuanRT avatar Jul 25 '22 07:07 LuanRT

LEGEND!! Thanks so much <3

OskarEichler avatar Jul 25 '22 08:07 OskarEichler

I think this issue isn't quite completed, it would be nice to have inbuilt library support for this.

BobVarioa avatar Jul 25 '22 14:07 BobVarioa

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 25 '22 03:08 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Oct 25 '22 04:10 github-actions[bot]

@LuanRT this issue should probably be reopened

ChunkyProgrammer avatar Dec 21 '22 02:12 ChunkyProgrammer