diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampExtractorHelper.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampExtractorHelper.java index b19c41dd1..c9a82a075 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampExtractorHelper.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampExtractorHelper.java @@ -43,7 +43,7 @@ public class BandcampExtractorHelper { /** * Translate all these parameters together to the URL of the corresponding album or track - * using the mobile api + * using the mobile API */ public static String getStreamUrlFromIds(final long bandId, final long itemId, final String itemType) throws ParsingException { @@ -51,7 +51,7 @@ public class BandcampExtractorHelper { try { final String jsonString = NewPipe.getDownloader().get( "https://bandcamp.com/api/mobile/22/tralbum_details?band_id=" + bandId - + "&tralbum_id=" + itemId + "&tralbum_type=" + itemType.substring(0, 1)) + + "&tralbum_id=" + itemId + "&tralbum_type=" + itemType.charAt(0)) .responseBody(); return JsonParser.object().from(jsonString).getString("bandcamp_url").replace("http://", "https://"); @@ -88,7 +88,7 @@ public class BandcampExtractorHelper { } - return String.valueOf(result); + return result.toString(); } /** diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampRadioInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampRadioInfoItemExtractor.java index b2e2d3642..c575a35fe 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampRadioInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampRadioInfoItemExtractor.java @@ -14,7 +14,7 @@ import static org.schabi.newpipe.extractor.services.bandcamp.extractors.Bandcamp public class BandcampRadioInfoItemExtractor implements StreamInfoItemExtractor { - private JsonObject show; + private final JsonObject show; public BandcampRadioInfoItemExtractor(final JsonObject radioShow) { show = radioShow; diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampSuggestionExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampSuggestionExtractor.java index cc7d384f3..9196e7c75 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampSuggestionExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampSuggestionExtractor.java @@ -37,7 +37,7 @@ public class BandcampSuggestionExtractor extends SuggestionExtractor { final JsonArray jsonArray = fuzzyResults.getObject("auto") .getArray("results"); - final ArrayList suggestions = new ArrayList<>(); + final List suggestions = new ArrayList<>(); for (final Object fuzzyResult : jsonArray) { final String res = ((JsonObject) fuzzyResult).getString("name"); @@ -52,6 +52,5 @@ public class BandcampSuggestionExtractor extends SuggestionExtractor { return Collections.emptyList(); } - } } diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampStreamLinkHandlerFactoryTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampStreamLinkHandlerFactoryTest.java index 85094827e..bf99fa308 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampStreamLinkHandlerFactoryTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampStreamLinkHandlerFactoryTest.java @@ -48,5 +48,6 @@ public class BandcampStreamLinkHandlerFactoryTest { assertTrue(linkHandler.acceptUrl("http://ZachBenson.Bandcamp.COM/Track/U-I-Tonite/")); assertTrue(linkHandler.acceptUrl("https://interovgm.com/track/title")); assertTrue(linkHandler.acceptUrl("http://bandcamP.com/?show=38")); + assertTrue(linkHandler.acceptUrl("https://goodgoodblood-tl.bandcamp.com/track/when-it-all-wakes-up")); } }