|
1 | 1 | <p align="center"> |
2 | | - <img alt="gopher" src="docs/media/pods.png"> |
| 2 | + <img alt="gopher" src="docs/media/pods.png"> |
3 | 3 | </p> |
4 | 4 | <p align="center"> |
5 | | -Scdl is the fastest SoundCloud music downloading CLI tool. Scdl utilizes a go routine pool ensuring multiple thread safe and fast downloads from SoundCloud within seconds. There are extended features such as search (no URL needed) recursively downloading all songs from a given playlist and more! |
| 5 | +A fast SoundCloud track downloader written in Go. Give it a track URL, get back an <code>.mp3</code> with embedded cover art. |
6 | 6 | </p> |
7 | | -<br> |
8 | 7 | <p align="center"> |
9 | 8 | <a href="https://goreportcard.com/report/github.com/imthaghost/scdl"><img src="https://goreportcard.com/badge/github.com/imthaghost/scdl"></a> |
10 | 9 | </p> |
11 | | -<br> |
12 | 10 |
|
13 | 11 |  |
14 | 12 |
|
15 | 13 | ## Table of Contents |
16 | 14 |
|
17 | | -- [Installation](#installation) |
18 | | -- [Usage](#usage) |
19 | | -- [Examples](#Examples) |
20 | | -- [Todo](#Todo) |
21 | | -- [License](#license) |
| 15 | +- [Installation](#installation) |
| 16 | +- [Usage](#usage) |
| 17 | +- [How it works](#how-it-works) |
| 18 | +- [Roadmap](#roadmap) |
| 19 | +- [License](#license) |
22 | 20 |
|
23 | | -## 🚀 Installation |
| 21 | +## Installation |
24 | 22 |
|
25 | | -### Brew |
| 23 | +### Homebrew |
26 | 24 |
|
27 | 25 | ```bash |
28 | | -# tap |
29 | 26 | brew tap imthaghost/scdl |
30 | | -# install tool |
31 | 27 | brew install scdl |
32 | 28 | ``` |
33 | 29 |
|
34 | | -### Manual |
| 30 | +### Go |
35 | 31 |
|
36 | 32 | ```bash |
37 | | -# go install :) |
38 | | -go install github.com/imthaghost/scdl/cmd/scdl@latest |
| 33 | +go install github.com/imthaghost/scdl@latest |
39 | 34 | ``` |
40 | 35 |
|
41 | | -### Binary |
| 36 | +### Pre-built binary |
42 | 37 |
|
43 | | -[Download Here](https://github.com/imthaghost/scdl/releases) |
| 38 | +Grab the latest release from the [releases page](https://github.com/imthaghost/scdl/releases). |
44 | 39 |
|
45 | 40 | ## Usage |
46 | 41 |
|
47 | | - ``-h, --help`` - Help screen and usage |
| 42 | +```bash |
| 43 | +scdl <track-url> |
| 44 | +``` |
48 | 45 |
|
49 | | - ``-s, --search`` - Option for searching for songs |
| 46 | +Example: |
50 | 47 |
|
| 48 | +```bash |
| 49 | +scdl https://soundcloud.com/polo-g/polo-g-feat-juice-wrld-flex |
| 50 | +``` |
51 | 51 |
|
52 | | -## Examples |
| 52 | +The file is written to the current directory as `<track title>.mp3` with the SoundCloud artwork embedded as an ID3v2 front-cover frame. |
53 | 53 |
|
54 | | -### Base Command |
55 | | -```bash |
56 | | -# command + SounCloud URL |
57 | | -scdl https://soundcloud.com/polo-g/polo-g-feat-juice-wrld-flex |
| 54 | +### Go+ / private tracks (authenticated downloads) |
| 55 | + |
| 56 | +Supply a SoundCloud OAuth token to unlock 256 kbps Go+ transcodings and to download private tracks your account can access. Either pass it on the flag: |
| 57 | + |
| 58 | +```bash |
| 59 | +scdl --token "$YOUR_TOKEN" <track-url> |
| 60 | +``` |
| 61 | + |
| 62 | +…or set it once in your shell: |
| 63 | + |
| 64 | +```bash |
| 65 | +export SCDL_TOKEN="your-token-here" |
| 66 | +scdl <track-url> |
58 | 67 | ``` |
59 | 68 |
|
| 69 | +To find your token: open soundcloud.com in your logged-in browser, open DevTools → Network, click any request to `api-v2.soundcloud.com`, and copy the value after `OAuth ` in the `Authorization` request header. |
60 | 70 |
|
| 71 | +Private share links (`?secret_token=s-XXX` or `/s-XXX`) are supported with or without a token. |
61 | 72 |
|
62 | | -## Todo |
| 73 | +## How it works |
63 | 74 |
|
64 | | -### Short term |
| 75 | +1. Fetches the track page and parses its `__sc_hydration` JSON. |
| 76 | +2. Scrapes a fresh `client_id` from SoundCloud's JS bundles. |
| 77 | +3. Builds an authenticated HLS playlist URL using the track's `track_authorization` token. |
| 78 | +4. Downloads every segment in parallel, decrypts any AES-128 segments, and assembles them in order. |
| 79 | +5. Writes the resulting MP3 and embeds the `og:image` cover art via [`bogem/id3v2`](https://github.com/bogem/id3v2). |
65 | 80 |
|
66 | | -- [x] Cobra command line interface |
67 | | -- [x] Download audio file from Soundcloud URL |
68 | | -- [x] Goroutine pool for downloading m3u8 file |
69 | | -- [x] Installation via Brew |
70 | | -- [x] Mp3 file contains image cover |
71 | | -- [x] Download a song through search functionality |
72 | | -- [ ] 80-100% test coverage |
73 | | -- [ ] Update tool for better performance |
74 | | -- [ ] Proxy flag |
75 | | -- [ ] Format flag |
76 | | -### Long term |
77 | | -- [ ] Search results |
78 | | -- [ ] Download all songs from a given playlist |
79 | | -- [ ] Download all songs from a given album |
| 81 | +## Roadmap |
80 | 82 |
|
81 | | -## 📝 License |
| 83 | +- [x] High-quality (256 kbps) downloads via SoundCloud Go+ auth ([#13](https://github.com/imthaghost/scdl/issues/13)) |
| 84 | +- [x] Private share-link downloads (`?secret_token=` / `/s-XXX`) ([#10](https://github.com/imthaghost/scdl/issues/10)) |
| 85 | +- [ ] Playlist / set URLs (`/sets/...`) |
| 86 | +- [ ] Non-zero exit code on download failure |
| 87 | +- [ ] `--output` / `-o` flag for output path |
| 88 | +- [ ] Proxy support |
82 | 89 |
|
83 | | -By contributing, you agree that your contributions will be licensed under its MIT License. |
| 90 | +## License |
84 | 91 |
|
85 | | -In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern. |
| 92 | +[MIT](https://choosealicense.com/licenses/mit/) — see [LICENSE](LICENSE). |
0 commit comments