From f735788a398d0b3f5b0298062098ccb093fb4b29 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Wed, 8 Dec 2021 21:00:53 +0100 Subject: [PATCH] Fixed Soundcloud hardcoded client id --- .../services/soundcloud/SoundcloudParsingHelper.java | 4 ++-- .../soundcloud/SoundcloudParsingHelperTest.java | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudParsingHelper.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudParsingHelper.java index 0a1fcee9..f2bd884e 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudParsingHelper.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudParsingHelper.java @@ -40,8 +40,8 @@ import static org.schabi.newpipe.extractor.ServiceList.SoundCloud; import static org.schabi.newpipe.extractor.utils.Utils.*; public class SoundcloudParsingHelper { - private static final String HARDCODED_CLIENT_ID = - "nGKlrpy2IotLQ0QGwBOmIgSFayis6H4e"; // Updated on 04/11/21 + static final String HARDCODED_CLIENT_ID = + "1NKODbzHzEpoowFHxTAmS7oB08DObPuK"; // Updated on 08/12/21 private static String clientId; public static final String SOUNDCLOUD_API_V2_URL = "https://api-v2.soundcloud.com/"; diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudParsingHelperTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudParsingHelperTest.java index 7d5c156b..925d73ec 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudParsingHelperTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudParsingHelperTest.java @@ -5,9 +5,13 @@ import org.junit.BeforeClass; import org.junit.Test; import org.schabi.newpipe.downloader.DownloaderTestImpl; import org.schabi.newpipe.extractor.NewPipe; +import org.schabi.newpipe.extractor.exceptions.ExtractionException; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import java.io.IOException; + public class SoundcloudParsingHelperTest { @BeforeClass public static void setUp() { @@ -20,6 +24,14 @@ public class SoundcloudParsingHelperTest { SoundcloudParsingHelper.checkIfHardcodedClientIdIsValid()); } + @Test + public void assertHardCodedClientIdMatchesCurrentClientId() throws IOException, ExtractionException { + assertEquals( + "Hardcoded client doesn't match extracted clientId", + SoundcloudParsingHelper.HARDCODED_CLIENT_ID, + SoundcloudParsingHelper.clientId()); + } + @Test public void resolveUrlWithEmbedPlayerTest() throws Exception { Assert.assertEquals("https://soundcloud.com/trapcity", SoundcloudParsingHelper.resolveUrlWithEmbedPlayer("https://api.soundcloud.com/users/26057743"));