Use content country if supported by SoundCloud

This commit is contained in:
wb9688 2017-08-22 14:47:51 +02:00
parent e2b7cb9c69
commit d07f6cdef7
1 changed files with 8 additions and 0 deletions

View File

@ -1,6 +1,8 @@
package org.schabi.newpipe.extractor.services.soundcloud;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import org.schabi.newpipe.extractor.StreamingService;
import org.schabi.newpipe.extractor.UrlIdHandler;
@ -57,6 +59,12 @@ public class SoundcloudChartsExtractor extends KioskExtractor {
apiUrl += "&kind=new";
}
List<String> supportedCountries = Arrays.asList("AU", "CA", "FR", "DE", "IE", "NL", "NZ", "GB", "US");
String contentCountry = getContentCountry();
if (supportedCountries.contains(contentCountry)) {
apiUrl += "&region=soundcloud:regions:" + contentCountry;
}
nextStreamsUrl = SoundcloudParsingHelper.getStreamsFromApi(collector, apiUrl, true);
return collector;
}