Skip to content

Commit

Permalink
Remove tailing slash from SoundCloud URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
Scrxtchy committed Oct 16, 2020
1 parent acb04eb commit b1b0529
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b1b0529

Please sign in to comment.