-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Certain channels do not resolve #297
Comments
The problem with the trailing slash was with my code. I have since fixed that, but I cannot push it until I finish my current YouTube API compliance review. The problem with certain channels not working at all is due to a limitation with the YouTube API. There is no way to get a channel from its custom URL, so popyt sort of mimics this by grabbing the end of the URL and searching for it. In the case of "fosterkittensofficial", their actual username is "Cindy Congdon", so "fosterkittensofficial" returns no results (and if it did, they would most likely be garbage). I have also edited the documentation of the Once my compliance review is complete, I will push these new changes and close this issue. Thanks! |
No worries and no rush! Glad a cause could be found. Yeah for urls where there's no id or username, I just grabbed the html as is then regexed the id: /(?<="channelId":")[A-Za-z0-9]{24}/g
/(?<="externalId":")[A-Za-z0-9]{24}/g
/(?<="browseId":")[A-Za-z0-9]{24}/g Wasn't sure if |
I would add this, but the wrapper is purely meant to use the YouTube Data
v3 API. The frontend can change unexpectedly, so scraping the website isn't
an option.
A good solution for anyone that really wants to be able to get a channel by
its custom URL, though.
…On Wed, Feb 17, 2021 at 11:51 PM Ron Au ***@***.***> wrote:
No worries and no rush! Glad a cause could be found.
Yeah for urls where there's no id or username, I just grabbed the html as
is then regexed the id:
/(?<="channelId":")[A-Za-z0-9]{24}/g
/(?<="externalId":")[A-Za-z0-9]{24}/g/(?<="browseId":")[A-Za-z0-9]{24}/g
Wasn't sure if channelId was always present so the other two are just
fallbacks.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#297 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIRI62R7B7SDW5RR2J7LPJDS7SMEZANCNFSM4VTH2FSQ>
.
|
Oh 100% agreed, just an account of how one person ended up resolving it. |
This may be a YouTube limitation but reporting here in case it's otherwise. If you try
getChannel()
with this URL it will fail with "Item not found" error:https://www.youtube.com/c/ChilledCow
but the same URL with a trailing slash will work just fine:
https://www.youtube.com/c/ChilledCow/
Using just "ChilledCow" also works. However, other channels do not work even with trailing slash or with only the end path.
When I load those failing URLs in the browser, they load fine and I can't discern any particular difference between the working and non-working URLs. Thank you for the library! 🙇🏼♂️
The text was updated successfully, but these errors were encountered: