TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
31.72k stars 3.08k forks source link

"Got HTML document, expected JSON response" error when opening a video #8736

Closed TheMCNerd2017 closed 2 years ago

TheMCNerd2017 commented 2 years ago

Checklist

Affected version

0.23.1

Steps to reproduce the bug

  1. Open any YouTube video.
  2. Video doesn't load and error comes up.

Expected behavior

Video and all related things should load properly.

Actual behavior

Video did not load at all (along with description, comments, etc) and the error comes up.

Screenshots/Screen recordings

No response

Logs

Exception

org.schabi.newpipe.extractor.exceptions.ParsingException: Got HTML document, expected JSON response (latest url was: "https://www.youtube.com/youtubei/v1/next?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&prettyPrint=false")
    at org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.getValidJsonResponseBody(YoutubeParsingHelper.java:1057)
    at org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.getJsonPostResponse(YoutubeParsingHelper.java:1074)
    at org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeStreamExtractor.onFetchPage(YoutubeStreamExtractor.java:824)
    at org.schabi.newpipe.extractor.Extractor.fetchPage(Extractor.java:60)
    at org.schabi.newpipe.extractor.stream.StreamInfo.getInfo(StreamInfo.java:78)
    at org.schabi.newpipe.extractor.stream.StreamInfo.getInfo(StreamInfo.java:73)
    at org.schabi.newpipe.util.ExtractorHelper.lambda$getStreamInfo$3(ExtractorHelper.java:118)
    at org.schabi.newpipe.util.ExtractorHelper.$r8$lambda$YTHJjScxCJNO1LTCqs3IKy35iyY(Unknown Source:0)
    at org.schabi.newpipe.util.ExtractorHelper$$ExternalSyntheticLambda6.call(Unknown Source:4)
    at io.reactivex.rxjava3.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:43)
    at io.reactivex.rxjava3.core.Single.subscribe(Single.java:4813)
    at io.reactivex.rxjava3.internal.operators.single.SingleDoOnSuccess.subscribeActual(SingleDoOnSuccess.java:35)
    at io.reactivex.rxjava3.core.Single.subscribe(Single.java:4813)
    at io.reactivex.rxjava3.internal.operators.maybe.MaybeFromSingle.subscribeActual(MaybeFromSingle.java:41)
    at io.reactivex.rxjava3.core.Maybe.subscribe(Maybe.java:5330)
    at io.reactivex.rxjava3.internal.operators.maybe.MaybeConcatArray$ConcatMaybeObserver.drain(MaybeConcatArray.java:153)
    at io.reactivex.rxjava3.internal.operators.maybe.MaybeConcatArray$ConcatMaybeObserver.request(MaybeConcatArray.java:78)
    at io.reactivex.rxjava3.internal.operators.flowable.FlowableElementAtMaybe$ElementAtSubscriber.onSubscribe(FlowableElementAtMaybe.java:66)
    at io.reactivex.rxjava3.internal.operators.maybe.MaybeConcatArray.subscribeActual(MaybeConcatArray.java:42)
    at io.reactivex.rxjava3.core.Flowable.subscribe(Flowable.java:15868)
    at io.reactivex.rxjava3.internal.operators.flowable.FlowableElementAtMaybe.subscribeActual(FlowableElementAtMaybe.java:36)
    at io.reactivex.rxjava3.core.Maybe.subscribe(Maybe.java:5330)
    at io.reactivex.rxjava3.internal.operators.maybe.MaybeToSingle.subscribeActual(MaybeToSingle.java:46)
    at io.reactivex.rxjava3.core.Single.subscribe(Single.java:4813)
    at io.reactivex.rxjava3.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
    at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:644)
    at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
    at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:920)


Affected Android/Custom ROM version

GrapheneOS 12

Affected device model

Pixel 4 XL

Additional information

Error only came up once, and I couldn't get it to come up again on other videos. Searching for the error on the bug tracker but got no results anywhere similar to what I encountered. I'm not sure if this is a YouTube change being tested or if it's normal behavior that comes up once in a while.

triallax commented 2 years ago

A similar error was mentioned in https://github.com/TeamNewPipe/NewPipe/issues/3921#issuecomment-664077924. Given that you couldn't reproduce this again, I'll close this issue, but if you (or anybody else) face this error again, please leave a comment and I'll reopen this.