sdm-pycli 1.1.1__tar.gz → 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sdm-pycli
3
- Version: 1.1.1
3
+ Version: 2.0.0
4
4
  Summary: A fast, zero-config CLI tool to download and sync playlists from Spotify, Apple Music, Tidal, YouTube, and SoundCloud.
5
5
  Author: Antares699
6
6
  License: MIT
@@ -20,6 +20,8 @@ Requires-Dist: requests>=2.31.0
20
20
  Requires-Dist: rich>=13.7.1
21
21
  Requires-Dist: typer>=0.12.0
22
22
  Requires-Dist: imageio-ffmpeg>=0.4.9
23
+ Requires-Dist: ytmusicapi>=1.5.0
24
+ Requires-Dist: spotapi>=1.2.0
23
25
  Dynamic: license-file
24
26
 
25
27
  # SDM - SDM Downloads Music
@@ -38,16 +40,19 @@ Recently, Spotify restricted their Web API, requiring developers to have a Premi
38
40
  - **Smart Syncing:** Two-way mirroring. Run `sdm sync` to fetch new tracks and clean up removed ones.
39
41
  - **Multi-Format:** Download in M4A (default), MP3, FLAC, or OPUS with native tags.
40
42
  - **Perfect Metadata:** Embeds Track, Artist, Album, Cover Art, Track/Disc Numbers, Genre, and Release Year.
41
- - **Advanced Processing:** Synced lyrics via LRCLIB, LUFS normalization, and SponsorBlock trimming.
43
+ - **Advanced Processing:** Synced lyrics via LRCLIB, custom 2-pass EBU R128 (-14 LUFS) audio normalization algorithm for perfectly balanced studio-grade levels without dynamic range compression artifacts, and SponsorBlock trimming.
42
44
 
43
45
  ## Installation
44
46
 
47
+ You must have [Python 3.8+](https://www.python.org/downloads/) installed on your system.
48
+ *(Windows users: Make sure to check the "Add Python to PATH" box during installation!)*
49
+
50
+ Install directly from PyPI:
51
+
45
52
  ```bash
46
53
  pip install sdm-pycli
47
54
  ```
48
55
 
49
- No additional software is required. `sdm` bundles everything it needs, including FFmpeg.
50
-
51
56
  ## Usage
52
57
 
53
58
  Open a terminal in the folder where you want your music saved, then run the commands below.
@@ -130,6 +135,70 @@ Example:
130
135
  sdm inject "C:\Users\You\Downloads\song.mp3" https://open.spotify.com/track/0VjIjW4GlUZAMYd2vXMi3b
131
136
  ```
132
137
 
138
+ ### Config
139
+
140
+ You can set persistent default options (like format, workers, or API keys) so you never have to type them again:
141
+
142
+ ```bash
143
+ sdm config --format flac --workers 5 --lastfm-key "YOUR_API_KEY"
144
+ ```
145
+
146
+ ### Tag
147
+
148
+ To recursively scan an existing local directory and enrich the audio files with extensive Last.fm metadata (Genres, Track Bios, and MusicBrainz IDs) without redownloading them, run:
149
+
150
+ ```bash
151
+ sdm tag [directory]
152
+ ```
153
+
154
+ Example:
155
+
156
+ ```bash
157
+ sdm tag "C:\Users\You\Music\My Playlist"
158
+ ```
159
+
160
+ ### Search
161
+
162
+ To search and download a single track directly from YouTube Music, run
163
+
164
+ ```bash
165
+ sdm search [query]
166
+ ```
167
+
168
+ Example:
169
+
170
+ ```bash
171
+ sdm search "Never Gonna Give You Up - Rick Astley"
172
+ ```
173
+
174
+ ### Stats
175
+
176
+ To show statistics for your local library (such as track count, total size, and format distribution), run
177
+
178
+ ```bash
179
+ sdm stats [directory]
180
+ ```
181
+
182
+ Example:
183
+
184
+ ```bash
185
+ sdm stats "C:\Users\You\Music"
186
+ ```
187
+
188
+ ### Migrate
189
+
190
+ To bulk convert a downloaded library to a different audio format, run
191
+
192
+ ```bash
193
+ sdm migrate --dir [directory] [target_format]
194
+ ```
195
+
196
+ Example:
197
+
198
+ ```bash
199
+ sdm migrate --dir "C:\Users\You\Music\FLAC Library" opus
200
+ ```
201
+
133
202
  ## Options & Flags
134
203
 
135
204
  | Flag | Description |
@@ -137,13 +206,17 @@ sdm inject "C:\Users\You\Downloads\song.mp3" https://open.spotify.com/track/0VjI
137
206
  | `-o, --output` | Save to a specific directory |
138
207
  | `-f, --format` | Audio format: `m4a`, `mp3`, `flac`, `opus` (default: `m4a`) |
139
208
  | `-w, --workers` | Number of concurrent downloads (default: `3`) |
209
+ | `--cleanup` | Run sync cleanup logic on a standard download to remove orphaned files |
210
+ | `--index` | Manually override the track index number when injecting a file |
211
+ | `--dir` | Target directory for the migrate and stats commands |
140
212
  | `--lyrics` | Fetch and embed synced lyrics from LRCLIB |
141
- | `--normalize` | Apply EBU R128 (-14 LUFS) volume normalization |
213
+ | `--normalize` | Apply custom 2-pass EBU R128 (-14 LUFS) volume normalization |
142
214
  | `--sponsor-block` | Trim non-music sections from YouTube sources |
143
215
  | `--dry-run` | Simulate a sync/download without making changes |
144
216
  | `--no-delete` | Download new tracks but never delete local files |
145
- | `--refresh-metadata` | Re-tag existing files with the latest metadata |
217
+ | `--refresh-metadata` | Re-tag existing files with the latest metadata (alias: `--refresh`) |
146
218
  | `--cookies` | Pass browser cookies for age-restricted content |
219
+ | `--lastfm-key` | Enable extensive track-level genres and wiki summaries via Last.fm API |
147
220
 
148
221
  Example with flags:
149
222
 
@@ -157,6 +230,7 @@ sdm download https://open.spotify.com/playlist/37i9dQZF1E8UXBoz02kGID -f flac --
157
230
 
158
231
  Unlike other tools that require your Premium credentials and risk permanent account bans by ripping directly from encrypted servers, `sdm` acts as a safe, unauthenticated metadata matcher. It reliably delivers DRM-free audio (up to 256kbps AAC or Opus) perfectly packaged to match the original release.
159
232
 
233
+
160
234
  ## Legal Disclaimer
161
235
 
162
236
  *Users are responsible for their actions. We do not support unauthorized downloading of copyrighted material. `sdm` is open-source (MIT License) for educational and personal use only.*
@@ -1,144 +1,216 @@
1
- # SDM - SDM Downloads Music
2
-
3
- `sdm` is a fast, lightweight, and zero-config CLI tool to download and sync Playlists, Albums, and Tracks from **Spotify, Apple Music, Tidal, YouTube, and SoundCloud**.
4
-
5
- ## Why sdm?
6
-
7
- Recently, Spotify restricted their Web API, requiring developers to have a Premium subscription, which broke popular open-source tools with `403 Forbidden` errors.
8
-
9
- `sdm` was built to completely bypass these restrictions. It uses native web scraping to extract flawless metadata directly from streaming services, pairs it with `yt-dlp` to fetch the highest-quality audio, and embeds the tags natively. No API keys required.
10
-
11
- ## Features
12
-
13
- - **Universal Support:** Spotify, Apple Music, Tidal, YouTube, and SoundCloud.
14
- - **Smart Syncing:** Two-way mirroring. Run `sdm sync` to fetch new tracks and clean up removed ones.
15
- - **Multi-Format:** Download in M4A (default), MP3, FLAC, or OPUS with native tags.
16
- - **Perfect Metadata:** Embeds Track, Artist, Album, Cover Art, Track/Disc Numbers, Genre, and Release Year.
17
- - **Advanced Processing:** Synced lyrics via LRCLIB, LUFS normalization, and SponsorBlock trimming.
18
-
19
- ## Installation
20
-
21
- ```bash
22
- pip install sdm-pycli
23
- ```
24
-
25
- No additional software is required. `sdm` bundles everything it needs, including FFmpeg.
26
-
27
- ## Usage
28
-
29
- Open a terminal in the folder where you want your music saved, then run the commands below.
30
-
31
- ### Playlist
32
-
33
- To download a playlist, run
34
-
35
- ```bash
36
- sdm download [playlistUrl]
37
- ```
38
-
39
- Example:
40
-
41
- ```bash
42
- sdm download https://open.spotify.com/playlist/37i9dQZF1E8NjgPSXnmGkI?si=O0kgUaFcQnatcvlZzS9yJw
43
- ```
44
-
45
- ### Album
46
-
47
- To download an album, run
48
-
49
- ```bash
50
- sdm download [albumUrl]
51
- ```
52
-
53
- Example:
54
-
55
- ```bash
56
- sdm download https://open.spotify.com/album/6eUW0wxWtzkFdaEFsTJto6?si=nYD6g_tZQvuFsMzyKG2sRA
57
- ```
58
-
59
- ### Track
60
-
61
- To download a single track, run
62
-
63
- ```bash
64
- sdm download [trackUrl]
65
- ```
66
-
67
- Example:
68
-
69
- ```bash
70
- sdm download https://open.spotify.com/track/4PTG3Z6ehGkBFwjybzWkR8?si=1d83934b63464e9e
71
- ```
72
-
73
- ### Apple Music
74
-
75
- Apple Music albums, playlists, and songs are also supported.
76
-
77
- ```bash
78
- sdm download https://music.apple.com/us/album/starboy/1440871397
79
- ```
80
-
81
- ### Sync
82
-
83
- `sdm` remembers the source URL for each folder. To update a previously downloaded folder with any changes from the remote playlist, run
84
-
85
- ```bash
86
- sdm sync [directory]
87
- ```
88
-
89
- Example:
90
-
91
- ```bash
92
- sdm sync "C:\Users\You\Music\My Playlist"
93
- ```
94
-
95
- ### Inject
96
-
97
- To import a local audio file into your playlist with official metadata and protect it from future sync deletions, run
98
-
99
- ```bash
100
- sdm inject [filePath] [trackUrl]
101
- ```
102
-
103
- Example:
104
-
105
- ```bash
106
- sdm inject "C:\Users\You\Downloads\song.mp3" https://open.spotify.com/track/0VjIjW4GlUZAMYd2vXMi3b
107
- ```
108
-
109
- ## Options & Flags
110
-
111
- | Flag | Description |
112
- |---|---|
113
- | `-o, --output` | Save to a specific directory |
114
- | `-f, --format` | Audio format: `m4a`, `mp3`, `flac`, `opus` (default: `m4a`) |
115
- | `-w, --workers` | Number of concurrent downloads (default: `3`) |
116
- | `--lyrics` | Fetch and embed synced lyrics from LRCLIB |
117
- | `--normalize` | Apply EBU R128 (-14 LUFS) volume normalization |
118
- | `--sponsor-block` | Trim non-music sections from YouTube sources |
119
- | `--dry-run` | Simulate a sync/download without making changes |
120
- | `--no-delete` | Download new tracks but never delete local files |
121
- | `--refresh-metadata` | Re-tag existing files with the latest metadata |
122
- | `--cookies` | Pass browser cookies for age-restricted content |
123
-
124
- Example with flags:
125
-
126
- ```bash
127
- sdm download https://open.spotify.com/playlist/37i9dQZF1E8UXBoz02kGID -f flac --lyrics --normalize
128
- ```
129
-
130
- ## Music Sourcing & Audio Quality
131
-
132
- `sdm` fetches flawless metadata (tags, cover art, tracklists) directly from Spotify, Apple Music, and Tidal, but sources the actual audio streams from YouTube.
133
-
134
- Unlike other tools that require your Premium credentials and risk permanent account bans by ripping directly from encrypted servers, `sdm` acts as a safe, unauthenticated metadata matcher. It reliably delivers DRM-free audio (up to 256kbps AAC or Opus) perfectly packaged to match the original release.
135
-
136
- ## Legal Disclaimer
137
-
138
- *Users are responsible for their actions. We do not support unauthorized downloading of copyrighted material. `sdm` is open-source (MIT License) for educational and personal use only.*
139
-
140
- ---
141
-
142
- **Important Notes:**
143
- - **Spotify Playlists** must be set to **Public**. Private playlists and personalized mixes will not work.
144
- - **Explicit Content:** If YouTube blocks downloads, pass browser cookies with `--cookies firefox`. Firefox is recommended.
1
+ # SDM - SDM Downloads Music
2
+
3
+ `sdm` is a fast, lightweight, and zero-config CLI tool to download and sync Playlists, Albums, and Tracks from **Spotify, Apple Music, Tidal, YouTube, and SoundCloud**.
4
+
5
+ ## Why sdm?
6
+
7
+ Recently, Spotify restricted their Web API, requiring developers to have a Premium subscription, which broke popular open-source tools with `403 Forbidden` errors.
8
+
9
+ `sdm` was built to completely bypass these restrictions. It uses native web scraping to extract flawless metadata directly from streaming services, pairs it with `yt-dlp` to fetch the highest-quality audio, and embeds the tags natively. No API keys required.
10
+
11
+ ## Features
12
+
13
+ - **Universal Support:** Spotify, Apple Music, Tidal, YouTube, and SoundCloud.
14
+ - **Smart Syncing:** Two-way mirroring. Run `sdm sync` to fetch new tracks and clean up removed ones.
15
+ - **Multi-Format:** Download in M4A (default), MP3, FLAC, or OPUS with native tags.
16
+ - **Perfect Metadata:** Embeds Track, Artist, Album, Cover Art, Track/Disc Numbers, Genre, and Release Year.
17
+ - **Advanced Processing:** Synced lyrics via LRCLIB, custom 2-pass EBU R128 (-14 LUFS) audio normalization algorithm for perfectly balanced studio-grade levels without dynamic range compression artifacts, and SponsorBlock trimming.
18
+
19
+ ## Installation
20
+
21
+ You must have [Python 3.8+](https://www.python.org/downloads/) installed on your system.
22
+ *(Windows users: Make sure to check the "Add Python to PATH" box during installation!)*
23
+
24
+ Install directly from PyPI:
25
+
26
+ ```bash
27
+ pip install sdm-pycli
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ Open a terminal in the folder where you want your music saved, then run the commands below.
33
+
34
+ ### Playlist
35
+
36
+ To download a playlist, run
37
+
38
+ ```bash
39
+ sdm download [playlistUrl]
40
+ ```
41
+
42
+ Example:
43
+
44
+ ```bash
45
+ sdm download https://open.spotify.com/playlist/37i9dQZF1E8NjgPSXnmGkI?si=O0kgUaFcQnatcvlZzS9yJw
46
+ ```
47
+
48
+ ### Album
49
+
50
+ To download an album, run
51
+
52
+ ```bash
53
+ sdm download [albumUrl]
54
+ ```
55
+
56
+ Example:
57
+
58
+ ```bash
59
+ sdm download https://open.spotify.com/album/6eUW0wxWtzkFdaEFsTJto6?si=nYD6g_tZQvuFsMzyKG2sRA
60
+ ```
61
+
62
+ ### Track
63
+
64
+ To download a single track, run
65
+
66
+ ```bash
67
+ sdm download [trackUrl]
68
+ ```
69
+
70
+ Example:
71
+
72
+ ```bash
73
+ sdm download https://open.spotify.com/track/4PTG3Z6ehGkBFwjybzWkR8?si=1d83934b63464e9e
74
+ ```
75
+
76
+ ### Apple Music
77
+
78
+ Apple Music albums, playlists, and songs are also supported.
79
+
80
+ ```bash
81
+ sdm download https://music.apple.com/us/album/starboy/1440871397
82
+ ```
83
+
84
+ ### Sync
85
+
86
+ `sdm` remembers the source URL for each folder. To update a previously downloaded folder with any changes from the remote playlist, run
87
+
88
+ ```bash
89
+ sdm sync [directory]
90
+ ```
91
+
92
+ Example:
93
+
94
+ ```bash
95
+ sdm sync "C:\Users\You\Music\My Playlist"
96
+ ```
97
+
98
+ ### Inject
99
+
100
+ To import a local audio file into your playlist with official metadata and protect it from future sync deletions, run
101
+
102
+ ```bash
103
+ sdm inject [filePath] [trackUrl]
104
+ ```
105
+
106
+ Example:
107
+
108
+ ```bash
109
+ sdm inject "C:\Users\You\Downloads\song.mp3" https://open.spotify.com/track/0VjIjW4GlUZAMYd2vXMi3b
110
+ ```
111
+
112
+ ### Config
113
+
114
+ You can set persistent default options (like format, workers, or API keys) so you never have to type them again:
115
+
116
+ ```bash
117
+ sdm config --format flac --workers 5 --lastfm-key "YOUR_API_KEY"
118
+ ```
119
+
120
+ ### Tag
121
+
122
+ To recursively scan an existing local directory and enrich the audio files with extensive Last.fm metadata (Genres, Track Bios, and MusicBrainz IDs) without redownloading them, run:
123
+
124
+ ```bash
125
+ sdm tag [directory]
126
+ ```
127
+
128
+ Example:
129
+
130
+ ```bash
131
+ sdm tag "C:\Users\You\Music\My Playlist"
132
+ ```
133
+
134
+ ### Search
135
+
136
+ To search and download a single track directly from YouTube Music, run
137
+
138
+ ```bash
139
+ sdm search [query]
140
+ ```
141
+
142
+ Example:
143
+
144
+ ```bash
145
+ sdm search "Never Gonna Give You Up - Rick Astley"
146
+ ```
147
+
148
+ ### Stats
149
+
150
+ To show statistics for your local library (such as track count, total size, and format distribution), run
151
+
152
+ ```bash
153
+ sdm stats [directory]
154
+ ```
155
+
156
+ Example:
157
+
158
+ ```bash
159
+ sdm stats "C:\Users\You\Music"
160
+ ```
161
+
162
+ ### Migrate
163
+
164
+ To bulk convert a downloaded library to a different audio format, run
165
+
166
+ ```bash
167
+ sdm migrate --dir [directory] [target_format]
168
+ ```
169
+
170
+ Example:
171
+
172
+ ```bash
173
+ sdm migrate --dir "C:\Users\You\Music\FLAC Library" opus
174
+ ```
175
+
176
+ ## Options & Flags
177
+
178
+ | Flag | Description |
179
+ |---|---|
180
+ | `-o, --output` | Save to a specific directory |
181
+ | `-f, --format` | Audio format: `m4a`, `mp3`, `flac`, `opus` (default: `m4a`) |
182
+ | `-w, --workers` | Number of concurrent downloads (default: `3`) |
183
+ | `--cleanup` | Run sync cleanup logic on a standard download to remove orphaned files |
184
+ | `--index` | Manually override the track index number when injecting a file |
185
+ | `--dir` | Target directory for the migrate and stats commands |
186
+ | `--lyrics` | Fetch and embed synced lyrics from LRCLIB |
187
+ | `--normalize` | Apply custom 2-pass EBU R128 (-14 LUFS) volume normalization |
188
+ | `--sponsor-block` | Trim non-music sections from YouTube sources |
189
+ | `--dry-run` | Simulate a sync/download without making changes |
190
+ | `--no-delete` | Download new tracks but never delete local files |
191
+ | `--refresh-metadata` | Re-tag existing files with the latest metadata (alias: `--refresh`) |
192
+ | `--cookies` | Pass browser cookies for age-restricted content |
193
+ | `--lastfm-key` | Enable extensive track-level genres and wiki summaries via Last.fm API |
194
+
195
+ Example with flags:
196
+
197
+ ```bash
198
+ sdm download https://open.spotify.com/playlist/37i9dQZF1E8UXBoz02kGID -f flac --lyrics --normalize
199
+ ```
200
+
201
+ ## Music Sourcing & Audio Quality
202
+
203
+ `sdm` fetches flawless metadata (tags, cover art, tracklists) directly from Spotify, Apple Music, and Tidal, but sources the actual audio streams from YouTube.
204
+
205
+ Unlike other tools that require your Premium credentials and risk permanent account bans by ripping directly from encrypted servers, `sdm` acts as a safe, unauthenticated metadata matcher. It reliably delivers DRM-free audio (up to 256kbps AAC or Opus) perfectly packaged to match the original release.
206
+
207
+
208
+ ## Legal Disclaimer
209
+
210
+ *Users are responsible for their actions. We do not support unauthorized downloading of copyrighted material. `sdm` is open-source (MIT License) for educational and personal use only.*
211
+
212
+ ---
213
+
214
+ **Important Notes:**
215
+ - **Spotify Playlists** must be set to **Public**. Private playlists and personalized mixes will not work.
216
+ - **Explicit Content:** If YouTube blocks downloads, pass browser cookies with `--cookies firefox`. Firefox is recommended.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "sdm-pycli"
7
- version = "1.1.1"
7
+ version = "2.0.0"
8
8
  description = "A fast, zero-config CLI tool to download and sync playlists from Spotify, Apple Music, Tidal, YouTube, and SoundCloud."
9
9
  readme = "README.md"
10
10
  authors = [
@@ -24,7 +24,9 @@ dependencies = [
24
24
  "requests>=2.31.0",
25
25
  "rich>=13.7.1",
26
26
  "typer>=0.12.0",
27
- "imageio-ffmpeg>=0.4.9"
27
+ "imageio-ffmpeg>=0.4.9",
28
+ "ytmusicapi>=1.5.0",
29
+ "spotapi>=1.2.0"
28
30
  ]
29
31
  requires-python = ">=3.8"
30
32
 
@@ -1,3 +1,3 @@
1
1
  """SDM - SDM Downloads Music. A fast CLI tool to download and sync playlists from Spotify, Apple Music, Tidal, YouTube, and SoundCloud."""
2
2
 
3
- __version__ = "1.1.1"
3
+ __version__ = "2.0.0"