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

java.lang.NullPointerException when opening an age restricted video #6726

Closed
4 tasks done
Duvio opened this issue Jul 21, 2021 · 21 comments
Closed
4 tasks done

java.lang.NullPointerException when opening an age restricted video #6726

Duvio opened this issue Jul 21, 2021 · 21 comments
Labels
bug Issue is related to a bug requires extractor change This issue requires a change to the extractor youtube Service, https://www.youtube.com/

Comments

@Duvio
Copy link

Duvio commented Jul 21, 2021

Steps to reproduce the bug

  1. Search for "https://youtube.com/watch?v=6-Q2NTYM3SM" in the NewPipe app search bar
  2. Open the video
  3. See the error

Actual behavior

It's shown that an error happened and the video doesnt play

Expected behavior

There should be no error and the video should play normally

Logs

Exception

  • User Action: requested stream
  • Request: https://youtube.com/watch?v=6-Q2NTYM3SM
  • Content Country: DE
  • Content Language: en-DE
  • App Language: en_DE
  • Service: YouTube
  • Version: 0.21.7
  • OS: Linux Android 10 - 29
Crash log

java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
	at java.io.StringReader.<init>(StringReader.java:50)
	at com.grack.nanojson.JsonParser$JsonParserContext.from(Unknown Source:6)
	at org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeStreamExtractor.fetchVideoInfoPage(YoutubeStreamExtractor.java:793)
	at org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeStreamExtractor.onFetchPage(YoutubeStreamExtractor.java:724)
	at org.schabi.newpipe.extractor.Extractor.fetchPage(Extractor.java:54)
	at org.schabi.newpipe.extractor.stream.StreamInfo.getInfo(StreamInfo.java:68)
	at org.schabi.newpipe.extractor.stream.StreamInfo.getInfo(StreamInfo.java:64)
	at org.schabi.newpipe.util.ExtractorHelper.lambda$getStreamInfo$3(ExtractorHelper.java:116)
	at org.schabi.newpipe.util.-$$Lambda$ExtractorHelper$YTHJjScxCJNO1LTCqs3IKy35iyY.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:15753)
	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:614)
	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:919)


It was one of those videos that YouTube wants you to verify your age for

@Duvio Duvio added the bug Issue is related to a bug label Jul 21, 2021
@rogerdc
Copy link

rogerdc commented Jul 22, 2021

Reproducible on LG G6 running Android 8.0.0.

Edit to add: This was on a video that was scheduled for a premiere.

@FTC55
Copy link

FTC55 commented Jul 22, 2021

Reproducible on Samsung S20+ running android 11

@coggy9
Copy link

coggy9 commented Jul 22, 2021

Reproducible with a OnePlus 7T on Android 11, AOSP based custom ROM.

@FTC55
Copy link

FTC55 commented Jul 22, 2021

that video requires authentication, with either OAuth Authorization header or Cookie headers

It's not just that video, it seems like all age restricted videos face the same issue.

@iiSnewoNL

This comment has been minimized.

@infinitewaveparticle

This comment has been minimized.

@Mhowser

This comment has been minimized.

@iiSnewoNL
Copy link

Will the bug be fixed in the next update or?

@vehosah

This comment has been minimized.

@iiSnewoNL

This comment has been minimized.

@AudricV AudricV added requires extractor change This issue requires a change to the extractor youtube Service, https://www.youtube.com/ labels Jul 31, 2021
@AudricV
Copy link
Member

AudricV commented Jul 31, 2021

Can you try the APK in AudricV#1? You should be able to watch age-restricted videos with this APK, except the ones for which playback on other websites has been disabled by the video owner (there is no solution found for now which doesn't require a login to a YouTube account for these videos).

@vehosah
Copy link

vehosah commented Jul 31, 2021 via email

@AudricV
Copy link
Member

AudricV commented Jul 31, 2021

@vehosah Did you enable Show age restricted content in Settings, Content and did you read carefully my comment? We are not able to extract the streaming URLs for all age-restricted videos right now.

@vehosah
Copy link

vehosah commented Jul 31, 2021 via email

@AudricV
Copy link
Member

AudricV commented Jul 31, 2021

@vehosah Sorry, I didn't understand you. Here is the direct link to the APK: https://github.com/TiA4f8R/NewPipe/suites/3378370309/artifacts/79610287. You need to decompress the APK to be able to install it. If you can't, please try an other browser to download the APK (you need to be logged on GitHub to download Artifacts).

@AudricV
Copy link
Member

AudricV commented Jul 31, 2021

For users who have bugs with the APK you have downloaded, here is a reupload of it: app.zip

@iiSnewoNL
Copy link

iiSnewoNL commented Aug 1, 2021

For users who have bugs with the APK you have downloaded, here is a reupload of it: app.zip

The apk is working well indeed. I hope it will work for a long time though. Thanks! 😀

@infinitewaveparticle
Copy link

infinitewaveparticle commented Aug 2, 2021 via email

@iiSnewoNL
Copy link

iiSnewoNL commented Aug 2, 2021

@TiA4f8R Does this apk also include the fixes for buffering?

Well I don't have any issues concerning buffering, but what helps for me is reloading the video and playing it again. 👌

@AudricV
Copy link
Member

AudricV commented Aug 3, 2021

The crash has been fixed for all age-restricted videos (and unavailable videos) with TeamNewPipe/NewPipeExtractor#604. You will be able to watch age-restricted videos (except the ones for which playback on other websites has been disabled by the video owner) in the next release.

@AudricV AudricV closed this as completed Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug requires extractor change This issue requires a change to the extractor youtube Service, https://www.youtube.com/
Projects
None yet
Development

No branches or pull requests

10 participants