Skip to content

Commit 1a9bc8c

Browse files
authored
Merge pull request #414 from Scrxtchy/soundcloud-slash
Remove tailing slash from SoundCloud URLs
2 parents 9a785f9 + 6a70cb9 commit 1a9bc8c

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamExtractor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public SoundcloudStreamExtractor(StreamingService service, LinkHandler linkHandl
4646

4747
@Override
4848
public void onFetchPage(@Nonnull Downloader downloader) throws IOException, ExtractionException {
49-
track = SoundcloudParsingHelper.resolveFor(downloader, getOriginalUrl());
49+
track = SoundcloudParsingHelper.resolveFor(downloader, getUrl());
5050

5151
String policy = track.getString("policy", EMPTY_STRING);
5252
if (!policy.equals("ALLOW") && !policy.equals("MONETIZE")) {

extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudStreamLinkHandlerFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public String getUrl(String id) throws ParsingException {
3030
@Override
3131
public String getId(String url) throws ParsingException {
3232
Utils.checkUrl(URL_PATTERN, url);
33+
// Remove the tailing slash from URLs due to issues with the SoundCloud API
34+
if (url.charAt(url.length() -1) == '/') url = url.substring(0, url.length()-1);
3335

3436
try {
3537
return SoundcloudParsingHelper.resolveIdWithEmbedPlayer(url);

0 commit comments

Comments
 (0)