-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
Better error message when using certain APIs with unsupported ClientType #555
Comments
@iBicha Use This is basically a feature request instead of a bug report, because getInfo is currently only written to support the web client. |
I tried |
You aren't passing the client name string to |
Aha, thanks
I guess it got a bit confusing since I wasn't aware that PS: I'm ok with leaving the issue open for a better error message or closing |
It used to be possible to create a session with one client and then use a different client to get the info (e.g. you need WEB for most things but then want to get the video/streaming information with the android client), which is why that parameter exists and is why you need to specify the client to getBasicInfo, if you want to deviate from the default. Not sure if YouTube still allows you to do that though. |
Just passing the client name string to the getInfo/getBasicInfo functions will do, no need to change the entire instance's client. I understand it's a tad confusing, we should probably have better documentation for this. |
Is it possible to fetch the HomeFeed as TV client to get a different structure to match the Youtube TV apps? |
YouTube.js doesn't have support for anything TV related yet. It would also only be possible to use it from node or deno out of the box, because YouTube restricts the TV frontend to specific user-agents. |
Ah okay interesting, it is only a bit misleading then that the ClientType TVEmbedded exists for some reason. 😅 |
@Duell10111 That only works for getBasicInfo and is the only client that doesn't require you to login for age-restricted videos. |
Will likely require throwing errors in most methods if a client isn't the web one. Not great, but at least people will know that they are doing unsupported stuff, instead of being confused by other errors. |
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. |
Unstale, I think is still relevant |
I still get this error.
InnertubeError: Request to https://www.youtube.com/youtubei/v1/browse?prettyPrint=false&alt=json failed with status 404 Node.js v18.16.0 |
@meghe2000 If it only works with the WEB client, then that's what you should be using. YouTube.js only supports other clients with very specific functions, specifically |
In other clients, the data loading speed is much faster. And in the loading speed test, I came to this conclusion: WEB: 2.2000 ms For this reason, I prefer to use another client. |
@meghe2000 Speed doesn't matter when you are trying to do stuff that YouTube.js doesn't support. Your choices are:
|
The discussion on which client to use is not the point. The point is the library should throw "Client X is not supported in this function, please use Y". A clear and concise message is better trying to find an issue on Github (if any) that might or might not have a solution. |
@iBicha Creating sessions works completely fine, the error is coming from the call to |
Steps to reproduce
This works. Set it to
ClientType.ANDROID
,ClientType.IOS
orClientType.TV_EMBEDDED
then it does notFailure Logs
Expected behavior
For different clients to be able to pull video info and generate dash manifest
Current behavior
Only WEB seems to work
Version
Edge
Anything else?
No response
Checklist
The text was updated successfully, but these errors were encountered: