alaouy / YouTube

🔥 Laravel PHP Facade/Wrapper for the Youtube Data API
MIT License
778 stars 204 forks source link

[bug] getChannelByName returning wrong channel #150

Closed ibrunotome closed 3 years ago

ibrunotome commented 4 years ago

For example:

->getChannelByName('santicristo') should return data of UCnHTWQ-oA6fyhLluEris6qw channel, but the return is of the UCYN9J-V6B-YWuWxvftP-y6w channel.

Decicus commented 4 years ago

That's not a bug.

->getChannelByName('santicristo') returns this channel: https://www.youtube.com/user/santicristo
The returned ID displays the correct channel if you use the alternative URL format: https://www.youtube.com/channel/UCYN9J-V6B-YWuWxvftP-y6w

The channel ID you specified is a completely different YouTube channel: https://www.youtube.com/channel/UCnHTWQ-oA6fyhLluEris6qw But I guess you were referring to the "custom URL" format, which matches: https://www.youtube.com/c/santicristo

From what I understand it's currently not possible to translate "Custom URL" to "Channel ID".