TeamNewPipe / NewPipe

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

Crashes when open Bandcamp #11074

Closed cw2k closed 2 months ago

cw2k commented 4 months ago

Checklist

Affected version

0.27.0

Steps to reproduce the bug

  1. Switch to Bandcamp mode
  2. Paste and load http://projectconvolution.bandcamp.com

Expected behavior

Parse website and load songs.

Actual behavior

Crash on load. Seems like it can't parse the website data correctly.

Screenshots/Screen recordings

No response

Logs

Exception

org.schabi.newpipe.extractor.exceptions.ParsingException: Download failed
    at org.schabi.newpipe.extractor.services.bandcamp.linkHandler.BandcampChannelLinkHandlerFactory.getId(BandcampChannelLinkHandlerFactory.java:45)
    at org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory.fromUrl(LinkHandlerFactory.java:83)
    at org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory.fromUrl(ListLinkHandlerFactory.java:41)
    at org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory.fromUrl(ListLinkHandlerFactory.java:35)
    at org.schabi.newpipe.extractor.StreamingService.getChannelExtractor(StreamingService.java:280)
    at org.schabi.newpipe.extractor.channel.ChannelInfo.getInfo(ChannelInfo.java:51)
    at org.schabi.newpipe.util.ExtractorHelper.lambda$getChannelInfo$4(ExtractorHelper.java:126)
    at org.schabi.newpipe.util.ExtractorHelper.$r8$lambda$BOLWstv98dC8pFAG_uir5gPXYwY(ExtractorHelper.java:0)
    at org.schabi.newpipe.util.ExtractorHelper$$ExternalSyntheticLambda13.call(R8$$SyntheticClass:0)
    at io.reactivex.rxjava3.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:43)
    at io.reactivex.rxjava3.core.Single.subscribe(Single.java:4855)
    at io.reactivex.rxjava3.internal.operators.single.SingleDoOnSuccess.subscribeActual(SingleDoOnSuccess.java:35)
    at io.reactivex.rxjava3.core.Single.subscribe(Single.java:4855)
    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:919)
Caused by: java.net.UnknownServiceException: CLEARTEXT communication to projectconvolution.bandcamp.com not permitted by network security policy
    at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:188)
    at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
    at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
    at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
    at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
    at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
    at org.schabi.newpipe.DownloaderImpl.execute(DownloaderImpl.java:163)
    at org.schabi.newpipe.extractor.downloader.Downloader.get(Downloader.java:77)
    at org.schabi.newpipe.extractor.downloader.Downloader.get(Downloader.java:32)
    at org.schabi.newpipe.extractor.services.bandcamp.linkHandler.BandcampChannelLinkHandlerFactory.getId(BandcampChannelLinkHandlerFactory.java:36)
    ... 21 more
    Suppressed: java.net.UnknownServiceException: CLEARTEXT communication to projectconvolution.bandcamp.com not permitted by network security policy
        ... 40 more
    Suppressed: java.net.UnknownServiceException: CLEARTEXT communication to projectconvolution.bandcamp.com not permitted by network security policy
        ... 40 more
    Suppressed: java.net.UnknownServiceException: CLEARTEXT communication to projectconvolution.bandcamp.com not permitted by network security policy
        ... 40 more


Affected Android/Custom ROM version

No response

Affected device model

No response

Additional information

No response

opusforlife2 commented 4 months ago

Changing that http to https is a workaround.

Interestingly, once it loads, swiping from the About tab to Tracks causes a crash.

cw2k commented 4 months ago

Nice. Sometimes things can be simple.

Anyway I wonder about ya exception handling strategy. Seem there are no try...catch handling at all. So each tiny little error crashes the whole app.

Why not put up some crash handlers at critical functions/ modules like ExtractorHelper or Download that catches and reports errors there. Image a playlist with pleny titles and just one 'critical' link. Skip this because an error occurred is no big deal. However stopping the music and the need to restart the app is really annoying especially when driving car and you need to stop to fiddle around on the smartphone.

fynngodau commented 4 months ago

PR: https://github.com/TeamNewPipe/NewPipeExtractor/pull/1177