Merge pull request #414 from Scrxtchy/soundcloud-slash

Remove tailing slash from SoundCloud URLs
This commit is contained in:
Tobias Groza 2020-10-16 09:48:44 +02:00 committed by GitHub
commit 1a9bc8caf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -46,7 +46,7 @@ public class SoundcloudStreamExtractor extends StreamExtractor {
@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")) {

View File

@ -30,6 +30,8 @@ public class SoundcloudStreamLinkHandlerFactory extends LinkHandlerFactory {
@Override
public String getId(String url) throws ParsingException {
Utils.checkUrl(URL_PATTERN, url);
// Remove the tailing slash from URLs due to issues with the SoundCloud API
if (url.charAt(url.length() -1) == '/') url = url.substring(0, url.length()-1);
try {
return SoundcloudParsingHelper.resolveIdWithEmbedPlayer(url);