From 932d094d6ab85ab4c439e1df07c53a312fe35c2e Mon Sep 17 00:00:00 2001 From: Fynn Godau Date: Sun, 2 Aug 2020 16:55:18 +0200 Subject: [PATCH] Upgrade featured playlist urls to https --- .../BandcampPlaylistInfoItemFeaturedExtractor.java | 3 +-- .../services/bandcamp/BandcampFeaturedExtractorTest.java | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampPlaylistInfoItemFeaturedExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampPlaylistInfoItemFeaturedExtractor.java index 814794284..968bff22a 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampPlaylistInfoItemFeaturedExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampPlaylistInfoItemFeaturedExtractor.java @@ -1,7 +1,6 @@ package org.schabi.newpipe.extractor.services.bandcamp.extractors; import com.grack.nanojson.JsonObject; -import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.playlist.PlaylistInfoItemExtractor; import static org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampExtractorHelper.getImageUrl; @@ -31,7 +30,7 @@ public class BandcampPlaylistInfoItemFeaturedExtractor implements PlaylistInfoIt @Override public String getUrl() { - return featuredStory.getString("item_url"); + return featuredStory.getString("item_url").replaceAll("http://", "https://"); } @Override diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampFeaturedExtractorTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampFeaturedExtractorTest.java index 09f516be9..f0502d579 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampFeaturedExtractorTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampFeaturedExtractorTest.java @@ -37,4 +37,10 @@ public class BandcampFeaturedExtractorTest { assertTrue(list.size() > 1); } + @Test + public void testHttps() throws ExtractionException, IOException { + List list = extractor.getInitialPage().getItems(); + assertTrue(list.get(0).getUrl().contains("https://")); + } + }