sdm-pycli 0.1.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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hack Club Flavortown Shipper
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,133 @@
1
+ Metadata-Version: 2.4
2
+ Name: sdm-pycli
3
+ Version: 0.1.0
4
+ Summary: A fast, lightweight, and reliable CLI tool to download and sync Spotify playlists, albums, and tracks.
5
+ Author: Hack Club Flavortown Shipper
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/Antares699/sdm
8
+ Project-URL: Bug Tracker, https://github.com/Antares699/sdm/issues
9
+ Keywords: spotify,download,sync,music,cli
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Environment :: Console
14
+ Requires-Python: >=3.8
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Requires-Dist: yt-dlp>=2024.03.10
18
+ Requires-Dist: mutagen>=1.47.0
19
+ Requires-Dist: requests>=2.31.0
20
+ Requires-Dist: spotapi>=1.0.0
21
+ Requires-Dist: rich>=13.7.1
22
+ Requires-Dist: typer>=0.12.0
23
+ Requires-Dist: imageio-ffmpeg>=0.4.9
24
+ Dynamic: license-file
25
+
26
+ # SDM - SDM Downloads Music
27
+
28
+ `sdm` is a fast, lightweight, and incredibly reliable CLI tool to download and sync Spotify Playlists, Albums, and Tracks directly to your local machine.
29
+
30
+ ## Why sdm?
31
+
32
+ Recently, Spotify restricted their Web API, requiring developers to have a Premium subscription, which broke popular open-source tools with 403 Forbidden errors.
33
+
34
+ `sdm` completely bypasses the official API restrictions. It cleverly uses public metadata scraping and the spotapi library to extract precise track data (including cover art) and relies on yt-dlp to fetch the highest quality M4A audio available on YouTube. It then tags the files flawlessly.
35
+
36
+ ## Features
37
+
38
+ * No API Keys Required: Bypasses Spotify's Premium API requirements. Zero rate limits.
39
+ * **Universal Support:** Downloads Playlists, Albums, and Tracks from **Spotify, YouTube, YouTube Music, and SoundCloud**.
40
+ * **Smart Syncing:** The `--sync` flag mirrors your source folder perfectly, handling deletions cleanly.
41
+ * **M3U Generator:** Automatically creates a playable `.m3u` file to preserve the precise Spotify track order.
42
+ * **Flawless Metadata:** Embeds precise tags natively: Track, Artist, Cover Art, Track Number, Disc Number, Album Name, Album Artist, Genre, Release Year, and original Spotify URL.
43
+ * **Advanced Extras:** Built-in auto-lyrics embedding, LUFS audio normalization, and SponsorBlock trimming.
44
+
45
+ ## Installation
46
+
47
+ Since sdm is a standard Python package, installation is simple. Just run:
48
+
49
+ ```bash
50
+ pip install sdm-pycli
51
+ ```
52
+
53
+ **Requirements:**
54
+ No additional software is required. `sdm` bundles everything it needs (including `ffmpeg`) during installation.
55
+
56
+ ## Usage
57
+
58
+ Once installed, the `sdm` command is available globally in your terminal.
59
+
60
+ ### Download
61
+ Download a playlist, album, or track to your current directory:
62
+ ```bash
63
+ sdm download "https://open.spotify.com/playlist/YOUR_PLAYLIST_ID"
64
+ ```
65
+
66
+ ### Custom Output Directory
67
+ Use the `-o` or `--output` flag to specify where the songs should be saved:
68
+ ```bash
69
+ sdm download "https://open.spotify.com/album/YOUR_ALBUM_ID" -o "./My Music"
70
+ ```
71
+
72
+ ### Sync (Two-way mirroring)
73
+ If you add or remove songs from your Spotify playlist, run the same command with `--sync`. sdm will instantly download the new songs and delete any local songs that are no longer in the Spotify playlist.
74
+
75
+ *Bonus:* When downloading or syncing, `sdm` automatically generates a `_playlist.m3u` file. Double-clicking this in VLC, iTunes, or car stereos ensures your tracks play in the **exact custom order** they appear on Spotify!
76
+
77
+ `sdm` is smart—if you manually inject a track using the `inject` command (see below), it is marked as "protected" in your local `.sync.json` database and will **never be deleted** during a cleanup, even if it's not in the Spotify playlist anymore!
78
+ ```bash
79
+ sdm download "https://open.spotify.com/playlist/YOUR_PLAYLIST_ID" -o "./My Playlist" --sync
80
+ ```
81
+
82
+ ### Turbo Mode (Concurrent Workers)
83
+ Want it faster? Use `-w` or `--workers` to download up to 10 songs at the exact same time:
84
+ ```bash
85
+ sdm download "https://open.spotify.com/playlist/YOUR_PLAYLIST_ID" -o "./My Playlist" -w 5
86
+ ```
87
+
88
+ ### Advanced Features (Lyrics, Normalization, SponsorBlock)
89
+ `sdm` offers advanced flags to give you the ultimate listening experience:
90
+ * `--lyrics`: Automatically fetches perfectly synced lyrics from LRCLIB and embeds them natively into the `.m4a` file. Apple Music and mobile players will display scrolling lyrics effortlessly.
91
+ * `--normalize`: Applies EBU R128 (`-14 LUFS`) audio normalization via `ffmpeg`. This ensures all downloaded (and injected) tracks play at the exact same studio volume level, just like Spotify.
92
+ * `--sponsor-block`: Automatically removes 30-second skits, talking intros, and silence from YouTube Music Videos using the crowdsourced SponsorBlock API.
93
+
94
+ ```bash
95
+ sdm download "https://open.spotify.com/playlist/YOUR_PLAYLIST_ID" -o "./My Playlist" --lyrics --normalize --sponsor-block
96
+ ```
97
+
98
+ ### Manual Injection (`inject`)
99
+ If you have a high-quality local file (e.g., a FLAC or a MP3) and want to weave it into your playlist with official metadata:
100
+ ```bash
101
+ sdm inject "C:\Downloads\my_song.mp3" "https://open.spotify.com/track/..." -o "./My Playlist"
102
+ ```
103
+ `sdm` will:
104
+ * Convert your file to the playlist-standard `.m4a` format automatically via the bundled `ffmpeg`.
105
+ * Fetch and embed the official Spotify metadata and high-res cover art.
106
+ * **Auto-Indexing:** It natively searches your local sync cache to automatically name the file with the correct track number based on your specific playlist order (e.g., `103 - Artist - Title.m4a`). No more typing manual indexes!
107
+
108
+ ### Interactive DRM Fallback
109
+ When YouTube blocks an explicit track due to aggressive DRM/App-Bound Encryption, `sdm` doesn't just fail. At the end of your massive syncing run, it groups all the blocked tracks together and provides an **interactive prompt** allowing you to:
110
+ * **Option A:** Automatically fallback to SoundCloud (Quick but potentially lower quality bootlegs).
111
+ * **Option B:** Exit and use the `sdm inject` command to manually add your own high-quality files instead.
112
+
113
+ ### Downloading Explicit or Age-Restricted Songs
114
+ YouTube automatically blocks downloaders from accessing age-restricted content (like explicit songs). To bypass this, `sdm` allows you to authenticate using your browser's cookies.
115
+
116
+ **Important Note for Chrome/Edge Users:**
117
+ Recent versions of Chrome and Edge use "App-Bound Encryption" which blocks external scripts from reading their cookies. If you try `--cookies chrome`, it will likely fail. Instead, please use one of the two reliable methods below:
118
+
119
+ **Method 1: The Firefox Method (Recommended & Native)**
120
+ Firefox does not encrypt its database. If you use Firefox, simply log into YouTube and run:
121
+ ```bash
122
+ sdm download "https://open.spotify.com/track/EXPLICIT_SONG_ID" --cookies firefox
123
+ ```
124
+
125
+ **Method 2: The Text File Method (For Chrome / Edge / Brave)**
126
+ If you use Chrome or Edge, you can easily export a text file containing your cookies.
127
+ 1. Install an open-source extension like "Get cookies.txt LOCALLY" on your browser.
128
+ 2. Go to YouTube.com, click the extension, and export `cookies.txt` to your folder.
129
+ 3. Pass the path to the text file using the cookies flag:
130
+ ```bash
131
+ sdm download "https://open.spotify.com/track/EXPLICIT_SONG_ID" --cookies "C:\path\to\your\cookies.txt"
132
+ ```
133
+
@@ -0,0 +1,108 @@
1
+ # SDM - SDM Downloads Music
2
+
3
+ `sdm` is a fast, lightweight, and incredibly reliable CLI tool to download and sync Spotify Playlists, Albums, and Tracks directly to your local machine.
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` completely bypasses the official API restrictions. It cleverly uses public metadata scraping and the spotapi library to extract precise track data (including cover art) and relies on yt-dlp to fetch the highest quality M4A audio available on YouTube. It then tags the files flawlessly.
10
+
11
+ ## Features
12
+
13
+ * No API Keys Required: Bypasses Spotify's Premium API requirements. Zero rate limits.
14
+ * **Universal Support:** Downloads Playlists, Albums, and Tracks from **Spotify, YouTube, YouTube Music, and SoundCloud**.
15
+ * **Smart Syncing:** The `--sync` flag mirrors your source folder perfectly, handling deletions cleanly.
16
+ * **M3U Generator:** Automatically creates a playable `.m3u` file to preserve the precise Spotify track order.
17
+ * **Flawless Metadata:** Embeds precise tags natively: Track, Artist, Cover Art, Track Number, Disc Number, Album Name, Album Artist, Genre, Release Year, and original Spotify URL.
18
+ * **Advanced Extras:** Built-in auto-lyrics embedding, LUFS audio normalization, and SponsorBlock trimming.
19
+
20
+ ## Installation
21
+
22
+ Since sdm is a standard Python package, installation is simple. Just run:
23
+
24
+ ```bash
25
+ pip install sdm-pycli
26
+ ```
27
+
28
+ **Requirements:**
29
+ No additional software is required. `sdm` bundles everything it needs (including `ffmpeg`) during installation.
30
+
31
+ ## Usage
32
+
33
+ Once installed, the `sdm` command is available globally in your terminal.
34
+
35
+ ### Download
36
+ Download a playlist, album, or track to your current directory:
37
+ ```bash
38
+ sdm download "https://open.spotify.com/playlist/YOUR_PLAYLIST_ID"
39
+ ```
40
+
41
+ ### Custom Output Directory
42
+ Use the `-o` or `--output` flag to specify where the songs should be saved:
43
+ ```bash
44
+ sdm download "https://open.spotify.com/album/YOUR_ALBUM_ID" -o "./My Music"
45
+ ```
46
+
47
+ ### Sync (Two-way mirroring)
48
+ If you add or remove songs from your Spotify playlist, run the same command with `--sync`. sdm will instantly download the new songs and delete any local songs that are no longer in the Spotify playlist.
49
+
50
+ *Bonus:* When downloading or syncing, `sdm` automatically generates a `_playlist.m3u` file. Double-clicking this in VLC, iTunes, or car stereos ensures your tracks play in the **exact custom order** they appear on Spotify!
51
+
52
+ `sdm` is smart—if you manually inject a track using the `inject` command (see below), it is marked as "protected" in your local `.sync.json` database and will **never be deleted** during a cleanup, even if it's not in the Spotify playlist anymore!
53
+ ```bash
54
+ sdm download "https://open.spotify.com/playlist/YOUR_PLAYLIST_ID" -o "./My Playlist" --sync
55
+ ```
56
+
57
+ ### Turbo Mode (Concurrent Workers)
58
+ Want it faster? Use `-w` or `--workers` to download up to 10 songs at the exact same time:
59
+ ```bash
60
+ sdm download "https://open.spotify.com/playlist/YOUR_PLAYLIST_ID" -o "./My Playlist" -w 5
61
+ ```
62
+
63
+ ### Advanced Features (Lyrics, Normalization, SponsorBlock)
64
+ `sdm` offers advanced flags to give you the ultimate listening experience:
65
+ * `--lyrics`: Automatically fetches perfectly synced lyrics from LRCLIB and embeds them natively into the `.m4a` file. Apple Music and mobile players will display scrolling lyrics effortlessly.
66
+ * `--normalize`: Applies EBU R128 (`-14 LUFS`) audio normalization via `ffmpeg`. This ensures all downloaded (and injected) tracks play at the exact same studio volume level, just like Spotify.
67
+ * `--sponsor-block`: Automatically removes 30-second skits, talking intros, and silence from YouTube Music Videos using the crowdsourced SponsorBlock API.
68
+
69
+ ```bash
70
+ sdm download "https://open.spotify.com/playlist/YOUR_PLAYLIST_ID" -o "./My Playlist" --lyrics --normalize --sponsor-block
71
+ ```
72
+
73
+ ### Manual Injection (`inject`)
74
+ If you have a high-quality local file (e.g., a FLAC or a MP3) and want to weave it into your playlist with official metadata:
75
+ ```bash
76
+ sdm inject "C:\Downloads\my_song.mp3" "https://open.spotify.com/track/..." -o "./My Playlist"
77
+ ```
78
+ `sdm` will:
79
+ * Convert your file to the playlist-standard `.m4a` format automatically via the bundled `ffmpeg`.
80
+ * Fetch and embed the official Spotify metadata and high-res cover art.
81
+ * **Auto-Indexing:** It natively searches your local sync cache to automatically name the file with the correct track number based on your specific playlist order (e.g., `103 - Artist - Title.m4a`). No more typing manual indexes!
82
+
83
+ ### Interactive DRM Fallback
84
+ When YouTube blocks an explicit track due to aggressive DRM/App-Bound Encryption, `sdm` doesn't just fail. At the end of your massive syncing run, it groups all the blocked tracks together and provides an **interactive prompt** allowing you to:
85
+ * **Option A:** Automatically fallback to SoundCloud (Quick but potentially lower quality bootlegs).
86
+ * **Option B:** Exit and use the `sdm inject` command to manually add your own high-quality files instead.
87
+
88
+ ### Downloading Explicit or Age-Restricted Songs
89
+ YouTube automatically blocks downloaders from accessing age-restricted content (like explicit songs). To bypass this, `sdm` allows you to authenticate using your browser's cookies.
90
+
91
+ **Important Note for Chrome/Edge Users:**
92
+ Recent versions of Chrome and Edge use "App-Bound Encryption" which blocks external scripts from reading their cookies. If you try `--cookies chrome`, it will likely fail. Instead, please use one of the two reliable methods below:
93
+
94
+ **Method 1: The Firefox Method (Recommended & Native)**
95
+ Firefox does not encrypt its database. If you use Firefox, simply log into YouTube and run:
96
+ ```bash
97
+ sdm download "https://open.spotify.com/track/EXPLICIT_SONG_ID" --cookies firefox
98
+ ```
99
+
100
+ **Method 2: The Text File Method (For Chrome / Edge / Brave)**
101
+ If you use Chrome or Edge, you can easily export a text file containing your cookies.
102
+ 1. Install an open-source extension like "Get cookies.txt LOCALLY" on your browser.
103
+ 2. Go to YouTube.com, click the extension, and export `cookies.txt` to your folder.
104
+ 3. Pass the path to the text file using the cookies flag:
105
+ ```bash
106
+ sdm download "https://open.spotify.com/track/EXPLICIT_SONG_ID" --cookies "C:\path\to\your\cookies.txt"
107
+ ```
108
+
@@ -0,0 +1,37 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "sdm-pycli"
7
+ version = "0.1.0"
8
+ description = "A fast, lightweight, and reliable CLI tool to download and sync Spotify playlists, albums, and tracks."
9
+ readme = "README.md"
10
+ authors = [
11
+ { name = "Hack Club Flavortown Shipper" }
12
+ ]
13
+ license = { text = "MIT" }
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Operating System :: OS Independent",
18
+ "Environment :: Console",
19
+ ]
20
+ keywords = ["spotify", "download", "sync", "music", "cli"]
21
+ dependencies = [
22
+ "yt-dlp>=2024.03.10",
23
+ "mutagen>=1.47.0",
24
+ "requests>=2.31.0",
25
+ "spotapi>=1.0.0",
26
+ "rich>=13.7.1",
27
+ "typer>=0.12.0",
28
+ "imageio-ffmpeg>=0.4.9"
29
+ ]
30
+ requires-python = ">=3.8"
31
+
32
+ [project.urls]
33
+ "Homepage" = "https://github.com/Antares699/sdm"
34
+ "Bug Tracker" = "https://github.com/Antares699/sdm/issues"
35
+
36
+ [project.scripts]
37
+ sdm = "sdm.cli:main"
@@ -0,0 +1,3 @@
1
+ """SDM - SDM Downloads Music. A fast CLI tool to download and sync Spotify playlists."""
2
+
3
+ __version__ = "0.1.0"