From 67de0285e155f41c6810305b8dfe135da20086df Mon Sep 17 00:00:00 2001 From: Fynn Godau Date: Mon, 20 Apr 2020 22:03:29 +0200 Subject: [PATCH] Bandcamp: Generate query JSON in a proper way --- .../extractors/BandcampChannelExtractor.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampChannelExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampChannelExtractor.java index 9c1572cd4..fd068e60e 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampChannelExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampChannelExtractor.java @@ -2,10 +2,7 @@ package org.schabi.newpipe.extractor.services.bandcamp.extractors; -import com.grack.nanojson.JsonArray; -import com.grack.nanojson.JsonObject; -import com.grack.nanojson.JsonParser; -import com.grack.nanojson.JsonParserException; +import com.grack.nanojson.*; import org.jsoup.Jsoup; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.StreamingService; @@ -43,7 +40,12 @@ public class BandcampChannelExtractor extends ChannelExtractor { NewPipe.getDownloader().post( "https://bandcamp.com/api/mobile/22/band_details", null, - ("{\"band_id\":\"" + id + "\"}").getBytes() + JsonWriter.string() + .object() + .value("band_id", id) + .end() + .done() + .getBytes() ).responseBody() ); } catch (IOException | ReCaptchaException | JsonParserException e) {