From 663cab58808f1d803c47f3229d322bf8360fc80d Mon Sep 17 00:00:00 2001 From: WhiskeyLemur <83845540+WhiskeyLemur@users.noreply.github.com> Date: Tue, 3 Jun 2025 14:30:51 -0400 Subject: [PATCH] Add functionality for shortened share links Fixes #546 Expands the URL parsing to function with valid 'on.soundcloud.com' links generated from the Share function on tracks. --- scdl/scdl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scdl/scdl.py b/scdl/scdl.py index 7ce7d48..327e52a 100644 --- a/scdl/scdl.py +++ b/scdl/scdl.py @@ -470,7 +470,8 @@ def validate_url(client: SoundCloud, url: str) -> str: # see if link redirects to soundcloud.com try: resp = requests.get(url) - if url.startswith(("https://soundcloud.com", "http://soundcloud.com")): + if url.startswith(("https://soundcloud.com", "http://soundcloud.com", + "https://on.soundcloud.com", "http://on.soundcloud.com")): return urllib.parse.urljoin(resp.url, urllib.parse.urlparse(resp.url).path) except Exception: # see if given a username instead of url