Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove tailing slash from SoundCloud URLs #414

Merged
merged 1 commit into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,8 @@ public String getUrl(String id) throws ParsingException {
@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);
Scrxtchy marked this conversation as resolved.
Show resolved Hide resolved

try {
return SoundcloudParsingHelper.resolveIdWithEmbedPlayer(url);
Expand Down