Skip to content
Open
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ scdl -l https://soundcloud.com/pandadub/sets/the-lost-ship --sync archive.txt

# Download your likes (with authentification token)
scdl me -f

# Use yt-dlp impersonation (requires curl_cffi)
scdl -l https://soundcloud.com/ihatemyselfbeats/t-1 --impersonate chrome
# See yt-dlp --list-impersonate-targets for a list of targets
```

## Options:
Expand Down Expand Up @@ -96,6 +100,7 @@ scdl me -f
--add-description Adds the description to a seperate txt file (can be read by some players)
--no-playlist Skip downloading playlists
--opus Prefer downloading opus streams over mp3 streams
--impersonate [target] Forward yt-dlp's --impersonate (requires curl_cffi)
--yt-dlp-args String with custom args to forward to yt-dlp
```

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description = "Download Music from Souncloud"
readme = "README.md"
requires-python = ">=3.9.0"
dependencies = [
"curl_cffi>=0.14.0",
"docopt-ng>=0.9.0",
"mutagen>=1.47.0",
"soundcloud-v2>=1.6.1",
Expand Down
9 changes: 8 additions & 1 deletion scdl/scdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[--original-name][--original-metadata][--no-original][--only-original]
[--name-format <format>][--strict-playlist][--playlist-name-format <format>]
[--client-id <id>][--auth-token <token>][--overwrite][--no-playlist][--opus]
[--add-description][--yt-dlp-args <argstring>]
[--add-description][--impersonate <target>][--yt-dlp-args <argstring>]

scdl -h | --help
scdl --version
Expand Down Expand Up @@ -69,6 +69,7 @@
--no-playlist Skip downloading playlists
--add-description Adds the description to a separate txt file
--opus Prefer downloading opus streams over mp3 streams
--impersonate [target] Forward yt-dlp's --impersonate (requires curl_cffi)
--yt-dlp-args [argstring] String with custom args to forward to yt-dlp
"""

Expand Down Expand Up @@ -155,6 +156,7 @@ class SCDLArgs(TypedDict):
sync: str | None
s: str | None
t: bool
impersonate: str | None
yt_dlp_args: str


Expand Down Expand Up @@ -502,6 +504,11 @@ def _build_ytdl_params(url: str, scdl_args: SCDLArgs) -> tuple[str, dict, list]:
if scdl_args.get("opus"):
params["--extractor-args"] = "soundcloud:formats=*_aac,*_opus,*_mp3"

if scdl_args.get("impersonate"):
params["--impersonate"] = scdl_args.get("impersonate")
elif scdl_args.get("t"):
params["--impersonate"] = "chrome"

argv = []
for param, value in params.items():
if value is False:
Expand Down