Skip to content

Commit d07f6cd

Browse files
committed
Use content country if supported by SoundCloud
1 parent e2b7cb9 commit d07f6cd

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudChartsExtractor.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package org.schabi.newpipe.extractor.services.soundcloud;
22

33
import java.io.IOException;
4+
import java.util.Arrays;
5+
import java.util.List;
46

57
import org.schabi.newpipe.extractor.StreamingService;
68
import org.schabi.newpipe.extractor.UrlIdHandler;
@@ -57,6 +59,12 @@ public StreamInfoItemCollector getStreams() throws IOException, ExtractionExcept
5759
apiUrl += "&kind=new";
5860
}
5961

62+
List<String> supportedCountries = Arrays.asList("AU", "CA", "FR", "DE", "IE", "NL", "NZ", "GB", "US");
63+
String contentCountry = getContentCountry();
64+
if (supportedCountries.contains(contentCountry)) {
65+
apiUrl += "&region=soundcloud:regions:" + contentCountry;
66+
}
67+
6068
nextStreamsUrl = SoundcloudParsingHelper.getStreamsFromApi(collector, apiUrl, true);
6169
return collector;
6270
}

0 commit comments

Comments
 (0)