suno-archiver 1.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.
@@ -0,0 +1,3 @@
1
+ # Only needed if automatic browser-session detection doesn't work.
2
+ # Your Suno __client cookie (from DevTools; see README "Auth").
3
+ SUNO_COOKIE=your___client_cookie_here
@@ -0,0 +1,13 @@
1
+ .env
2
+ .env.*
3
+ !.env.example
4
+ .venv/
5
+ __pycache__/
6
+ *.py[cod]
7
+ dist/
8
+ build/
9
+ *.egg-info/
10
+ suno_archive/
11
+ suno_archive_*/
12
+ .suno-archiver-state.json
13
+ .DS_Store
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.0] - 2026-06-11
9
+
10
+ Initial release.
11
+
12
+ ### Added
13
+ - Archive your full Suno library: MP3 audio, cover art, and complete per-song metadata (prompt, tags, lyrics, duration, model, dates) as JSON, plus a master `library_index.json`
14
+ - Optional lossless WAV download via `--wav` (requests Suno's conversion and polls)
15
+ - Incremental sync with `--last-run`; date filtering with `--since`/`--until`
16
+ - Automatic browser-session auth (Chrome/Brave/Firefox/Safari/Arc/...) with `SUNO_COOKIE` manual fallback
17
+ - Concurrent downloads (4-worker pool); idempotent re-runs skip existing files
18
+ - `doctor` command to diagnose auth and API health
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hunter Shokrian
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,137 @@
1
+ Metadata-Version: 2.4
2
+ Name: suno-archiver
3
+ Version: 1.0.0
4
+ Summary: Archive your Suno music library: audio, cover art, and complete metadata, with incremental sync
5
+ Author-email: Hunter Shokrian <hnshokrian@gmail.com>
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Keywords: ai-music,archive,backup,cli,downloader,music-generation,suno
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Environment :: Console
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Topic :: Multimedia :: Sound/Audio
14
+ Requires-Python: >=3.9
15
+ Requires-Dist: click>=8.0.0
16
+ Requires-Dist: python-dotenv>=1.0.0
17
+ Requires-Dist: requests>=2.28.0
18
+ Requires-Dist: rookiepy>=0.5.0
19
+ Description-Content-Type: text/markdown
20
+
21
+ # suno-archiver
22
+
23
+ Archive your entire Suno music library — MP3 audio, cover art, and full metadata — with one command.
24
+
25
+ ## Why
26
+
27
+ Suno's web UI only lets you download tracks one at a time. If you've generated more than a handful, pulling them all by hand is tedious-to-impossible. This tool grabs your **entire** library in one command — audio, cover art, and full metadata as JSON — organized on your own disk.
28
+
29
+ Useful if you:
30
+
31
+ - have a large library (hundreds or thousands of generations) and want it all local — for a DAW, a dataset, offline access, or your own bookkeeping. A 1,600-track pull is one run, not 1,600 clicks.
32
+ - want your data in a structured, scriptable form — every track's prompt, tags, model, and timestamps in JSON, plus a single `library_index.json` you can grep or query.
33
+ - don't want to depend on the cloud staying put. Suno's Warner Music deal (early 2026) pulled free download access ahead of schedule; terms can change again. A local copy doesn't.
34
+
35
+ Run it on a schedule with `--last-run` and the archive stays current automatically.
36
+
37
+ > **Tested at scale.** A full **1,668-track library** spanning two years (2024–2026) archived in a single run — **5.7 GB**, 99.9% success rate, no rate-limiting or throttling. The handful of missing files were dead/transient links on Suno's CDN, not failures of the tool — and a re-run picks them up.
38
+
39
+ ## What it grabs
40
+
41
+ | File | Details |
42
+ |---|---|
43
+ | `.mp3` | Audio (Suno's MP3 stream) |
44
+ | `.jpg` | Cover art |
45
+ | `.json` | Full metadata — prompt, tags, lyrics, duration, model version, created/updated dates |
46
+ | `library_index.json` | All songs in one file, grep/jq-friendly |
47
+ | `--wav` | Optional: triggers Suno's lossless conversion and downloads the WAV alongside the MP3 (slower — one conversion request per song) |
48
+
49
+ ## Important
50
+
51
+ - **Personal backup of your own creations only.** Do not scrape other users' libraries.
52
+ - **Audio downloads require a paid Suno plan** (Pro or Premier). Metadata-only runs work on free plans.
53
+ - **Undocumented API** — Suno can change or break this at any time. Run `suno-archiver doctor` if something stops working, and check for updates with `pip install -U suno-archiver`.
54
+
55
+ ## Install
56
+
57
+ ```bash
58
+ pipx install suno-archiver # recommended: isolated environment
59
+ # or
60
+ pip install suno-archiver
61
+ ```
62
+
63
+ Requires Python 3.9+.
64
+
65
+ ## Auth
66
+
67
+ ### Primary: just be logged in to suno.com in your browser
68
+
69
+ That's it. `suno-archiver` uses [rookiepy](https://github.com/thewh1teagle/rookiepy) to read your existing browser session cookie automatically. Works with Chrome, Brave, Firefox, Safari, Arc, Edge, and more — no manual steps needed.
70
+
71
+ ```bash
72
+ suno-archiver # rookiepy finds your session automatically
73
+ ```
74
+
75
+ ### Fallback: set SUNO_COOKIE manually
76
+
77
+ Use this if browser auto-detection fails (headless servers, CI, multiple profiles, or just for troubleshooting):
78
+
79
+ 1. Open [suno.com](https://suno.com) in Chrome and make sure you're logged in.
80
+ 2. Open DevTools → Network tab → reload the page.
81
+ 3. Click any request to `clerk.suno.com` (look for `client?__clerk_api_version=...`).
82
+ 4. Select the **Cookies** tab in the request detail panel.
83
+ 5. Find the `__client` cookie — it's a long three-segment JWT (looks like `eyJ...`).
84
+ 6. Copy its value.
85
+
86
+ ```bash
87
+ # .env file or shell environment
88
+ SUNO_COOKIE=eyJhbGci... # paste the full __client value here
89
+ ```
90
+
91
+ Then run `suno-archiver doctor` to confirm it's working.
92
+
93
+ ## Usage
94
+
95
+ ```bash
96
+ suno-archiver # full archive: MP3s + covers + metadata
97
+ suno-archiver --wav # also WAVs (slower: conversion per song)
98
+ suno-archiver --last-run # only what's new since the last run
99
+ suno-archiver --since "2 weeks ago"
100
+ suno-archiver --dir ~/Music/suno_archive
101
+ suno-archiver doctor # diagnose auth/API issues
102
+ ```
103
+
104
+ Re-runs are **idempotent** — existing files are skipped, so `--last-run` on a cron job keeps your archive current without re-downloading anything.
105
+
106
+ ## What lands on disk
107
+
108
+ ```
109
+ suno_archive/
110
+ ├── 2026-06/
111
+ │ ├── 2026-06-02_concrete-syncope_49291ca0.mp3
112
+ │ ├── 2026-06-02_concrete-syncope_49291ca0.jpg (cover art)
113
+ │ └── 2026-06-02_concrete-syncope_49291ca0.json (full metadata)
114
+ ├── library_index.json (everything, searchable with jq/grep)
115
+ └── .suno-archiver-state.json
116
+ ```
117
+
118
+ Songs are organized into `YYYY-MM/` month folders. The state file records the last run timestamp for `--last-run` incremental syncs.
119
+
120
+ ## Resilient by design
121
+
122
+ Archiving thousands of files over an undocumented API means things will occasionally go wrong mid-run. The tool is built so that they don't cost you:
123
+
124
+ - **Per-file errors never abort the run.** A dead CDN link (403) or a transient hiccup (503) is counted and reported, then the run continues. You get a clear tally at the end: `3333 downloaded, 0 skipped, 3 errors`.
125
+ - **Expired sessions self-heal.** Suno's auth tokens are short-lived; the tool transparently re-mints them, and retries once on a 401 before giving up.
126
+ - **Interrupted runs are safe.** The `--last-run` watermark is only saved when a fetch completes cleanly — so a connection drop or a kill mid-run can never cause the *next* incremental sync to silently skip tracks. You just re-run.
127
+ - **Re-runs are free.** Idempotent skipping means re-running after a partial failure costs nothing for already-downloaded files; only the gaps are retried.
128
+
129
+ If the tool ever stops working entirely (Suno changed their API), `suno-archiver doctor` tells you *which* layer broke — your login, the auth exchange, or the library endpoint — so you know whether to re-log-in or wait for an update.
130
+
131
+ ## Related
132
+
133
+ [replicate-predictions-downloader](https://github.com/closestfriend/replicate-predictions-downloader) — same idea for Replicate AI predictions: bulk-download all your generated outputs from Replicate's API.
134
+
135
+ ## License
136
+
137
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,117 @@
1
+ # suno-archiver
2
+
3
+ Archive your entire Suno music library — MP3 audio, cover art, and full metadata — with one command.
4
+
5
+ ## Why
6
+
7
+ Suno's web UI only lets you download tracks one at a time. If you've generated more than a handful, pulling them all by hand is tedious-to-impossible. This tool grabs your **entire** library in one command — audio, cover art, and full metadata as JSON — organized on your own disk.
8
+
9
+ Useful if you:
10
+
11
+ - have a large library (hundreds or thousands of generations) and want it all local — for a DAW, a dataset, offline access, or your own bookkeeping. A 1,600-track pull is one run, not 1,600 clicks.
12
+ - want your data in a structured, scriptable form — every track's prompt, tags, model, and timestamps in JSON, plus a single `library_index.json` you can grep or query.
13
+ - don't want to depend on the cloud staying put. Suno's Warner Music deal (early 2026) pulled free download access ahead of schedule; terms can change again. A local copy doesn't.
14
+
15
+ Run it on a schedule with `--last-run` and the archive stays current automatically.
16
+
17
+ > **Tested at scale.** A full **1,668-track library** spanning two years (2024–2026) archived in a single run — **5.7 GB**, 99.9% success rate, no rate-limiting or throttling. The handful of missing files were dead/transient links on Suno's CDN, not failures of the tool — and a re-run picks them up.
18
+
19
+ ## What it grabs
20
+
21
+ | File | Details |
22
+ |---|---|
23
+ | `.mp3` | Audio (Suno's MP3 stream) |
24
+ | `.jpg` | Cover art |
25
+ | `.json` | Full metadata — prompt, tags, lyrics, duration, model version, created/updated dates |
26
+ | `library_index.json` | All songs in one file, grep/jq-friendly |
27
+ | `--wav` | Optional: triggers Suno's lossless conversion and downloads the WAV alongside the MP3 (slower — one conversion request per song) |
28
+
29
+ ## Important
30
+
31
+ - **Personal backup of your own creations only.** Do not scrape other users' libraries.
32
+ - **Audio downloads require a paid Suno plan** (Pro or Premier). Metadata-only runs work on free plans.
33
+ - **Undocumented API** — Suno can change or break this at any time. Run `suno-archiver doctor` if something stops working, and check for updates with `pip install -U suno-archiver`.
34
+
35
+ ## Install
36
+
37
+ ```bash
38
+ pipx install suno-archiver # recommended: isolated environment
39
+ # or
40
+ pip install suno-archiver
41
+ ```
42
+
43
+ Requires Python 3.9+.
44
+
45
+ ## Auth
46
+
47
+ ### Primary: just be logged in to suno.com in your browser
48
+
49
+ That's it. `suno-archiver` uses [rookiepy](https://github.com/thewh1teagle/rookiepy) to read your existing browser session cookie automatically. Works with Chrome, Brave, Firefox, Safari, Arc, Edge, and more — no manual steps needed.
50
+
51
+ ```bash
52
+ suno-archiver # rookiepy finds your session automatically
53
+ ```
54
+
55
+ ### Fallback: set SUNO_COOKIE manually
56
+
57
+ Use this if browser auto-detection fails (headless servers, CI, multiple profiles, or just for troubleshooting):
58
+
59
+ 1. Open [suno.com](https://suno.com) in Chrome and make sure you're logged in.
60
+ 2. Open DevTools → Network tab → reload the page.
61
+ 3. Click any request to `clerk.suno.com` (look for `client?__clerk_api_version=...`).
62
+ 4. Select the **Cookies** tab in the request detail panel.
63
+ 5. Find the `__client` cookie — it's a long three-segment JWT (looks like `eyJ...`).
64
+ 6. Copy its value.
65
+
66
+ ```bash
67
+ # .env file or shell environment
68
+ SUNO_COOKIE=eyJhbGci... # paste the full __client value here
69
+ ```
70
+
71
+ Then run `suno-archiver doctor` to confirm it's working.
72
+
73
+ ## Usage
74
+
75
+ ```bash
76
+ suno-archiver # full archive: MP3s + covers + metadata
77
+ suno-archiver --wav # also WAVs (slower: conversion per song)
78
+ suno-archiver --last-run # only what's new since the last run
79
+ suno-archiver --since "2 weeks ago"
80
+ suno-archiver --dir ~/Music/suno_archive
81
+ suno-archiver doctor # diagnose auth/API issues
82
+ ```
83
+
84
+ Re-runs are **idempotent** — existing files are skipped, so `--last-run` on a cron job keeps your archive current without re-downloading anything.
85
+
86
+ ## What lands on disk
87
+
88
+ ```
89
+ suno_archive/
90
+ ├── 2026-06/
91
+ │ ├── 2026-06-02_concrete-syncope_49291ca0.mp3
92
+ │ ├── 2026-06-02_concrete-syncope_49291ca0.jpg (cover art)
93
+ │ └── 2026-06-02_concrete-syncope_49291ca0.json (full metadata)
94
+ ├── library_index.json (everything, searchable with jq/grep)
95
+ └── .suno-archiver-state.json
96
+ ```
97
+
98
+ Songs are organized into `YYYY-MM/` month folders. The state file records the last run timestamp for `--last-run` incremental syncs.
99
+
100
+ ## Resilient by design
101
+
102
+ Archiving thousands of files over an undocumented API means things will occasionally go wrong mid-run. The tool is built so that they don't cost you:
103
+
104
+ - **Per-file errors never abort the run.** A dead CDN link (403) or a transient hiccup (503) is counted and reported, then the run continues. You get a clear tally at the end: `3333 downloaded, 0 skipped, 3 errors`.
105
+ - **Expired sessions self-heal.** Suno's auth tokens are short-lived; the tool transparently re-mints them, and retries once on a 401 before giving up.
106
+ - **Interrupted runs are safe.** The `--last-run` watermark is only saved when a fetch completes cleanly — so a connection drop or a kill mid-run can never cause the *next* incremental sync to silently skip tracks. You just re-run.
107
+ - **Re-runs are free.** Idempotent skipping means re-running after a partial failure costs nothing for already-downloaded files; only the gaps are retried.
108
+
109
+ If the tool ever stops working entirely (Suno changed their API), `suno-archiver doctor` tells you *which* layer broke — your login, the auth exchange, or the library endpoint — so you know whether to re-log-in or wait for an update.
110
+
111
+ ## Related
112
+
113
+ [replicate-predictions-downloader](https://github.com/closestfriend/replicate-predictions-downloader) — same idea for Replicate AI predictions: bulk-download all your generated outputs from Replicate's API.
114
+
115
+ ## License
116
+
117
+ MIT — see [LICENSE](LICENSE).