dunkyl / SlyYTDAPI-Python

No-boilerplate, async YouTube Data API access. 😋
MIT License
3 stars 1 forks source link

Feature request: getting channel's data by `display name` #13

Open betterthanever2 opened 3 weeks ago

betterthanever2 commented 3 weeks ago

It would be nice to have a method on YouTubeData class that would take full url to a channel, and would return a Channel object with data from the snippet section of the original object..

dunkyl commented 3 weeks ago

That is a good idea. I have published a new version v0.4.9 with channel_by_url, which will accept id URLs (/channel/), handle URLs (/@), or username URLs (/c/<channel_username). That's the three kinds of URL that I am aware of, let me know if there are any others that might show up.

channel2 = await yt.channel_by_handle('@GoogleDevelopers')
channel2_ = await yt.channel_by_url('https://www.youtube.com/@googledevelopers')
assert channel2.id == channel2_.id
dunkyl commented 3 weeks ago

The issue title says "display name", but I am not aware of any URLs that use that? To clarify, the display name by YouTube's terminology is the non-unique name, like the Gmail name field.