Upgrade featured playlist urls to https

This commit is contained in:
Fynn Godau 2020-08-02 16:55:18 +02:00
parent c12ef3a02d
commit 932d094d6a
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -37,4 +37,10 @@ public class BandcampFeaturedExtractorTest {
assertTrue(list.size() > 1);
}
@Test
public void testHttps() throws ExtractionException, IOException {
List<PlaylistInfoItem> list = extractor.getInitialPage().getItems();
assertTrue(list.get(0).getUrl().contains("https://"));
}
}