Merge pull request #299 from B0pol/sc_countries
add supported countries for soundcloud
This commit is contained in:
commit
094b87c537
|
@ -11,6 +11,8 @@ import org.schabi.newpipe.extractor.stream.StreamInfoItemsCollector;
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import static org.schabi.newpipe.extractor.ServiceList.SoundCloud;
|
||||||
|
|
||||||
public class SoundcloudChartsExtractor extends KioskExtractor<StreamInfoItem> {
|
public class SoundcloudChartsExtractor extends KioskExtractor<StreamInfoItem> {
|
||||||
private StreamInfoItemsCollector collector = null;
|
private StreamInfoItemsCollector collector = null;
|
||||||
private String nextPageUrl = null;
|
private String nextPageUrl = null;
|
||||||
|
@ -57,11 +59,9 @@ public class SoundcloudChartsExtractor extends KioskExtractor<StreamInfoItem> {
|
||||||
apiUrl += "&kind=trending";
|
apiUrl += "&kind=trending";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*List<String> supportedCountries = Arrays.asList("AU", "CA", "FR", "DE", "IE", "NL", "NZ", "GB", "US");
|
|
||||||
String contentCountry = getContentCountry();
|
String contentCountry = SoundCloud.getContentCountry().getCountryCode();
|
||||||
if (supportedCountries.contains(contentCountry)) {
|
|
||||||
apiUrl += "®ion=soundcloud:regions:" + contentCountry;
|
apiUrl += "®ion=soundcloud:regions:" + contentCountry;
|
||||||
}*/
|
|
||||||
|
|
||||||
nextPageUrl = SoundcloudParsingHelper.getStreamsFromApi(collector, apiUrl, true);
|
nextPageUrl = SoundcloudParsingHelper.getStreamsFromApi(collector, apiUrl, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,11 +7,14 @@ import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||||
import org.schabi.newpipe.extractor.kiosk.KioskExtractor;
|
import org.schabi.newpipe.extractor.kiosk.KioskExtractor;
|
||||||
import org.schabi.newpipe.extractor.kiosk.KioskList;
|
import org.schabi.newpipe.extractor.kiosk.KioskList;
|
||||||
import org.schabi.newpipe.extractor.linkhandler.*;
|
import org.schabi.newpipe.extractor.linkhandler.*;
|
||||||
|
import org.schabi.newpipe.extractor.localization.ContentCountry;
|
||||||
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
|
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
|
||||||
import org.schabi.newpipe.extractor.search.SearchExtractor;
|
import org.schabi.newpipe.extractor.search.SearchExtractor;
|
||||||
import org.schabi.newpipe.extractor.stream.StreamExtractor;
|
import org.schabi.newpipe.extractor.stream.StreamExtractor;
|
||||||
import org.schabi.newpipe.extractor.subscription.SubscriptionExtractor;
|
import org.schabi.newpipe.extractor.subscription.SubscriptionExtractor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import static java.util.Collections.singletonList;
|
import static java.util.Collections.singletonList;
|
||||||
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.AUDIO;
|
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.AUDIO;
|
||||||
|
|
||||||
|
@ -46,6 +49,13 @@ public class SoundcloudService extends StreamingService {
|
||||||
return SoundcloudPlaylistLinkHandlerFactory.getInstance();
|
return SoundcloudPlaylistLinkHandlerFactory.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ContentCountry> getSupportedCountries() {
|
||||||
|
//Country selector here https://soundcloud.com/charts/top?genre=all-music
|
||||||
|
return ContentCountry.listFrom(
|
||||||
|
"AU", "CA", "DE", "FR", "GB", "IE", "NL", "NZ", "US"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StreamExtractor getStreamExtractor(LinkHandler LinkHandler) {
|
public StreamExtractor getStreamExtractor(LinkHandler LinkHandler) {
|
||||||
|
|
Loading…
Reference in New Issue