Merge pull request #28 from wb9688/kiosk
Use content country if supported by SoundCloud
This commit is contained in:
commit
f64c82f04c
|
@ -1,6 +1,8 @@
|
||||||
package org.schabi.newpipe.extractor.services.soundcloud;
|
package org.schabi.newpipe.extractor.services.soundcloud;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.schabi.newpipe.extractor.StreamingService;
|
import org.schabi.newpipe.extractor.StreamingService;
|
||||||
import org.schabi.newpipe.extractor.UrlIdHandler;
|
import org.schabi.newpipe.extractor.UrlIdHandler;
|
||||||
|
@ -57,6 +59,12 @@ public class SoundcloudChartsExtractor extends KioskExtractor {
|
||||||
apiUrl += "&kind=new";
|
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 += "®ion=soundcloud:regions:" + contentCountry;
|
||||||
|
}
|
||||||
|
|
||||||
nextStreamsUrl = SoundcloudParsingHelper.getStreamsFromApi(collector, apiUrl, true);
|
nextStreamsUrl = SoundcloudParsingHelper.getStreamsFromApi(collector, apiUrl, true);
|
||||||
return collector;
|
return collector;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue