TeamNewPipe / NewPipe

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

Parsing Error - Soundcloud #7413

Closed Feuerswut closed 1 year ago

Feuerswut commented 2 years ago

When searching SoundCloud: could not parse JSON response.

Exception

org.schabi.newpipe.extractor.exceptions.ParsingException: Could not parse json response
    at org.schabi.newpipe.extractor.services.soundcloud.extractors.SoundcloudSuggestionExtractor.suggestionList(SoundcloudSuggestionExtractor.java:48)
    at org.schabi.newpipe.util.ExtractorHelper.lambda$suggestionsFor$2(ExtractorHelper.java:107)
    at org.schabi.newpipe.util.ExtractorHelper.$r8$lambda$kgV3vMftlbQH0zdv8hszrHLyMLU(Unknown Source:0)
    at org.schabi.newpipe.util.ExtractorHelper$$ExternalSyntheticLambda8.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.SingleToObservable.subscribeActual(SingleToObservable.java:35)
    at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13102)
    at io.reactivex.rxjava3.internal.operators.observable.ObservableMap.subscribeActual(ObservableMap.java:33)
    at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13102)
    at io.reactivex.rxjava3.internal.operators.observable.ObservableZip$ZipCoordinator.subscribe(ObservableZip.java:110)
    at io.reactivex.rxjava3.internal.operators.observable.ObservableZip.subscribeActual(ObservableZip.java:72)
    at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13102)
    at io.reactivex.rxjava3.internal.operators.observable.ObservableMaterialize.subscribeActual(ObservableMaterialize.java:28)
    at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13102)
    at io.reactivex.rxjava3.internal.operators.observable.ObservableSwitchMap$SwitchMapObserver.onNext(ObservableSwitchMap.java:127)
    at io.reactivex.rxjava3.internal.operators.observable.ObservableConcatMap$ConcatMapDelayErrorObserver$DelayErrorInnerObserver.onNext(ObservableConcatMap.java:498)
    at io.reactivex.rxjava3.observers.SerializedObserver.onNext(SerializedObserver.java:113)
    at io.reactivex.rxjava3.internal.operators.observable.ObservableDebounceTimed$DebounceTimedObserver.emit(ObservableDebounceTimed.java:143)
    at io.reactivex.rxjava3.internal.operators.observable.ObservableDebounceTimed$DebounceEmitter.run(ObservableDebounceTimed.java:168)
    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)
Caused by: com.grack.nanojson.JsonParserException: Expected JSON value, got 0 on line 1, char 0
    at com.grack.nanojson.JsonTokener.createParseException(Unknown Source:44)
    at com.grack.nanojson.JsonParser.currentValue(Unknown Source:31)
    at com.grack.nanojson.JsonParser.parse(Unknown Source:4)
    at com.grack.nanojson.JsonParser$JsonParserContext.from(Unknown Source:19)
    at org.schabi.newpipe.extractor.services.soundcloud.extractors.SoundcloudSuggestionExtractor.suggestionList(SoundcloudSuggestionExtractor.java:40)
    ... 26 more


mstempell commented 2 years ago

Same problem here, exact same error trace, with this URL, coming from an instagram story click in the instragram app (the instagram "story" itself was the result of a track shared from soundcloud): https://soundcloud.com/dma-sc/what-have-you-done?ref=instagram&p=a&c=1&si=c0f717e597d44a30ab31f86dad762788&utm_campaign=social_sharing&utm_medium=story&utm_source=instagram

84436 commented 2 years ago

I got the exact same error and the same stack trace when I attempt to*: • get autocomplete hints when typing on the search bar • search for a song • open a SoundCloud link to a song from third-party apps (e.g. browsers) • open a SoundCloud link to an artist's profile from third-party apps (e.g. browsers)

Apparently SoundCloud support has been broken for a while; I guess this has something to do with NewPipeExtractor failing to parse the website/API response due to changes on SoundCloud's side? I'm not too well-versed in these backend things so I'm sorry if my input isn't helpful.

* tested on my physical device: NewPipe 0.21.16 (latest at the time of this writing) Android 11 (RKQ1.210503.001) MIUI Stable 12.5.14.0 Xiaomi, Mi 11 Lite 5G NE (codename: lisa)


EDIT: I think I found a workaround. I did the following steps, but I'm not sure which of these actually fixes the problem:

  1. Backup everything in the app (go to Settings → Content → Export database)
  2. Wipe the app data (open the App Info page of NewPipe from within the system Settings app)
  3. Re-import the data from step 1 (go to Settings → Content → Import database)
  4. Go to SoundCloud section (open the left navigation drawer, tap on the header, then tap SoundCloud (beta))
  5. If the first tab on the main screen is not "Default Kiosk", open the left navigation drawer again, then tap "Top 50" or "New & Hot".
  6. The content of the selected view ("Top 50" or "New & Hot") should be populated on the screen.

From this point on, SoundCloud functionalities (search and playback) become usable again.


By the way, I'm a bit curious about this error. Is there any way for me to see a bit more details (what API NewPipe called and the exact JSON response the app got) instead of a stacktrace?

opusforlife2 commented 1 year ago

@Feuerswut?

Feuerswut commented 1 year ago

yes?

I closed the issue cuz its old an SoundCloud search works now.

opusforlife2 commented 1 year ago

Thanks. I needed you to state the reason for future readers to understand.