From b1b05296ffc4121740c2a61a6c19bb00ca5c522d Mon Sep 17 00:00:00 2001 From: Scratch Date: Fri, 16 Oct 2020 13:39:58 +1100 Subject: [PATCH] Remove tailing slash from SoundCloud URLs Fixes #412 --- .../soundcloud/extractors/SoundcloudStreamExtractor.java | 2 +- .../linkHandler/SoundcloudStreamLinkHandlerFactory.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamExtractor.java index 6aee297d2d..d909acfc66 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamExtractor.java @@ -46,7 +46,7 @@ public SoundcloudStreamExtractor(StreamingService service, LinkHandler linkHandl @Override public void onFetchPage(@Nonnull Downloader downloader) throws IOException, ExtractionException { - track = SoundcloudParsingHelper.resolveFor(downloader, getOriginalUrl()); + track = SoundcloudParsingHelper.resolveFor(downloader, getUrl()); String policy = track.getString("policy", EMPTY_STRING); if (!policy.equals("ALLOW") && !policy.equals("MONETIZE")) { diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudStreamLinkHandlerFactory.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudStreamLinkHandlerFactory.java index e271345d57..34bf60ba0c 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudStreamLinkHandlerFactory.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudStreamLinkHandlerFactory.java @@ -30,6 +30,7 @@ public String getUrl(String id) throws ParsingException { @Override public String getId(String url) throws ParsingException { Utils.checkUrl(URL_PATTERN, url); + if (url.charAt(url.length() -1) == '/') url = url.substring(0, url.length()-1); try { return SoundcloudParsingHelper.resolveIdWithEmbedPlayer(url);