Skip to content

Commit 970bc7f

Browse files
authored
Merge pull request #359 from mauriciocolli/fix-client-id-bug
[SoundCloud] Fix concurrency issue when getting the client id
2 parents dbf6ab9 + 7505e82 commit 970bc7f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,21 @@
3737
import static org.schabi.newpipe.extractor.utils.Utils.replaceHttpWithHttps;
3838

3939
public class SoundcloudParsingHelper {
40-
private static final String HARDCODED_CLIENT_ID = "Uz4aPhG7GAl1VYGOnvOPW1wQ0M6xKtA9"; // Updated on 16/03/20
40+
private static final String HARDCODED_CLIENT_ID = "H2c34Q0E7hftqnuDHGsk88DbNqhYpgMm"; // Updated on 24/06/20
4141
private static String clientId;
4242

4343
private SoundcloudParsingHelper() {
4444
}
4545

46-
public static String clientId() throws ExtractionException, IOException {
46+
public synchronized static String clientId() throws ExtractionException, IOException {
4747
if (!isNullOrEmpty(clientId)) return clientId;
4848

4949
Downloader dl = NewPipe.getDownloader();
5050
clientId = HARDCODED_CLIENT_ID;
5151
if (checkIfHardcodedClientIdIsValid()) {
5252
return clientId;
53+
} else {
54+
clientId = null;
5355
}
5456

5557
final Response download = dl.get("https://soundcloud.com");

0 commit comments

Comments
 (0)