Skip to content
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

Youtube response doesn't contain "onResponseReceivedActions" resulting in java.lang.NullPointerException #1172

Open
sp1ritCS opened this issue May 5, 2024 · 0 comments

Comments

@sp1ritCS
Copy link

sp1ritCS commented May 5, 2024

When attempting to fetchPage on a ChannelExtractor extractor, I get the following error:

java.lang.NullPointerException: Cannot invoke "com.grack.nanojson.JsonArray.getObject(int)" because the return value of "com.grack.nanojson.JsonObject.getArray(String)" is null
	at org.schabi.newpipe.extractor.services.youtube.YoutubeChannelHelper.getChannelResponse(YoutubeChannelHelper.java:154)
	at org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeChannelExtractor.onFetchPage(YoutubeChannelExtractor.java:92)
	at org.schabi.newpipe.extractor.Extractor.fetchPage(Extractor.java:60)

This is due to the response json not containing the "onResponseReceivedActions" needed by the YoutubeChannelHelper.

I've attempted to replicate the request using curl, but this results in the same issue: curl -X POST "https://www.youtube.com/youtubei/v1/browse?prettyPrint=false" -H "Origin: https://www.youtube.com" -H "Cookie: SOCS=CAE=" -H "X-YouTube-Client-Name: 1" -H "Referer: https://www.youtube.com" -H "X-YouTube-Client-Version: 2.20240502.00.00" -H "Accept-Language: en-GB, en;q=0.9" -H "Content-Type: application/json" --data '{"context":{"client":{"hl":"en-GB","gl":"GB","clientName":"WEB","clientVersion":"2.20240502.00.00","originalUrl":"https://www.youtube.com","platform":"DESKTOP","utcOffsetMinutes":0},"request":{"internalExperimentFlags":[],"useSsl":true},"user":{"lockedSafetyMode":false}},"browseId":"UCE1jXbVAGJQEORz9nZqb5bQ","params":"EgZ2aWRlb3PyBgQKAjoA"}'

This both happens when using my custom downloader implementation and using the DownloaderImpl of newpipe with the android stuff stripped out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant