Skip to content

Commit d2f1c0f

Browse files
committed
[SoundCloud] Fix concurrency issue when getting the client id
1 parent 92f6754 commit d2f1c0f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@ public class SoundcloudParsingHelper {
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)