TeamNewPipe / TeamNewPipe/NewPipeExtractor
Youtube response doesn't contain "onResponseReceivedActions" resulting in java.lang.NullPointerException
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 2k
- Forks
- 602
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 6
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with YoutubeChannelHelper.java:154 and trace the fetchPage path through YoutubeChannelExtractor.java:92 and Extractor.java:60. Reproduce the ChannelExtractor request and inspect the response JSON when onResponseReceivedActions is absent. Done means the channel fetch no longer fails with a NullPointerException for that response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100