Skip to content

Commit f735788

Browse files
committed
Fixed Soundcloud hardcoded client id
1 parent f6f2724 commit f735788

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
import static org.schabi.newpipe.extractor.utils.Utils.*;
4141

4242
public class SoundcloudParsingHelper {
43-
private static final String HARDCODED_CLIENT_ID =
44-
"nGKlrpy2IotLQ0QGwBOmIgSFayis6H4e"; // Updated on 04/11/21
43+
static final String HARDCODED_CLIENT_ID =
44+
"1NKODbzHzEpoowFHxTAmS7oB08DObPuK"; // Updated on 08/12/21
4545
private static String clientId;
4646
public static final String SOUNDCLOUD_API_V2_URL = "https://api-v2.soundcloud.com/";
4747

extractor/src/test/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudParsingHelperTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55
import org.junit.Test;
66
import org.schabi.newpipe.downloader.DownloaderTestImpl;
77
import org.schabi.newpipe.extractor.NewPipe;
8+
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
89

10+
import static org.junit.Assert.assertEquals;
911
import static org.junit.Assert.assertTrue;
1012

13+
import java.io.IOException;
14+
1115
public class SoundcloudParsingHelperTest {
1216
@BeforeClass
1317
public static void setUp() {
@@ -20,6 +24,14 @@ public void assertThatHardcodedClientIdIsValid() throws Exception {
2024
SoundcloudParsingHelper.checkIfHardcodedClientIdIsValid());
2125
}
2226

27+
@Test
28+
public void assertHardCodedClientIdMatchesCurrentClientId() throws IOException, ExtractionException {
29+
assertEquals(
30+
"Hardcoded client doesn't match extracted clientId",
31+
SoundcloudParsingHelper.HARDCODED_CLIENT_ID,
32+
SoundcloudParsingHelper.clientId());
33+
}
34+
2335
@Test
2436
public void resolveUrlWithEmbedPlayerTest() throws Exception {
2537
Assert.assertEquals("https://soundcloud.com/trapcity", SoundcloudParsingHelper.resolveUrlWithEmbedPlayer("https://api.soundcloud.com/users/26057743"));

0 commit comments

Comments
 (0)