HN 표시: Apple 음악 재생 목록을 JSON으로 백업

hackernews | | 📦 오픈소스
#apple music #backup #data migration #json #playlists
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

Apple Music 계정 지역 변경 시 플레이리스트가 소실되는 문제를 해결하기 위해, 라이브러리를 JSON 파일로 백업하는 도구가 소개되었습니다. 이 도구는 곡명, 아티스트 정보와 함께 다른 플레이폼에서도 활용 가능한 ISRC 코드를 포함하여 추출하며, 브라우저 세션을 재생해 인증을 진행합니다. 사용자는 CLI 또는 웹 UI를 통해 자신의 데이터를 로컬에 안전하게 보관하고 추후 다른 서비스로의 이관에 활용할 수 있습니다.

본문

I am a digger with >6k tracks sorted into 100+ playlists in Apple Music, including one from my wedding. And I'm about to lose it all, because I need to change my Apple ID region, and Apple wipes your whole library when you do. The original region has no working payment methods left, so even if I stay, the subscription dies and the library goes with it within a few months. That's stupid and thankfully unnecessary. Your playlist curation is yours, not any streaming service's. Use this repository to back it up forever and reuse it on any platform. - Exports all your Apple Music playlists to a single JSON file with: - track name, artist, album - ISRC code (universal song ID that works across Spotify, Tidal, YouTube Music, etc.) - Replays your browser session to authorize in Apple Music. You log in via your browser and reuse the token it generates (see Authorization). - Allows you to sleep well at night. If this helped you, or if you tried, but met some troubles, let me know! - Human-readable archive — browse your playlists as plain text, search for songs, never forget what you had. - Transfer to Spotify / YouTube Music / Tidal / Deezer — every track includes an ISRC (International Standard Recording Code), which is a universal song fingerprint. Services like TuneMyMusic, Soundiiz, or a simple script can match ISRCs to recreate your playlists on any platform. It is not done by this repo yet, will potentially appear later - Feed into your own tools — the JSON is a flat array of playlists, easy to parse with Python, JS, or any language. Build stats, recommendations, or a personal music database. # install uv (skip if you already have it) curl -LsSf https://astral.sh/uv/install.sh | sh # clone and install git clone https://github.com/danisimov/backup-playlists cd backup-playlists # install dependencies uv sync # save your authorization token as cURL string into curl.txt The cURL command contains sensitive authentication tokens. Handle it with the same care as a password. - The authorization header carries a bearer token that grants read access to your Apple Music library. - The -b cookie string contains your Apple ID session cookie (myacinfo ), which could be used to act as you across Apple services. - Tokens expire within a few hours, but session cookies may last longer. If you suspect a leak, sign out of https://appleid.apple.com to invalidate all sessions. - This tool runs entirely on your machine. No data is sent anywhere except Apple's own API servers. - Never commit curl.txt , or any file containing these values to a public repository.curl.txt is listed in.gitignore . - Open https://music.apple.com/us/library/all-playlists/ in you browser and log in. - Open developer Open DevTools (F12) and open Network tab. - Click on the Network tab and filter by library-playlists . - Pick any request → right-click → Copy → Copy as cURL. - This copies your browser session tokens so the backup script can log in. - Save the copied string in a file named curl.txt (or paste it into the Streamlit text box). The cURL contains a session cookie and bearer token that typically expire within a few hours. You will need to re-copy it if the export fails with a 401/403 error. Don't share this string with anyone you don't trust. # run single command uv run cli.py Export is written to apple_music_backup.json in this directory. # start web ui, and follow on-screen commands uv run streamlit run app.py Open http://localhost:8501, paste the cURL into the text box, and press Export playlists. When finished you can download the JSON from the browser. [ { "id": "p.b16GGzDtbPrzXgz", "name": "A: Autechre", "tracks": [ { "id": "i.qQd8vaqCAEJda5d", "catalogId": "305139183", "name": "LCC", "artist": "Autechre", "album": "Untilted", "isrc": "GBBPW0500017" } ] } ] isrc is a unique ID which will help you find the track in any service of choice, e.g. Spotify. isrc will be null for tracks that were removed from the Apple Music catalog. backup-playlists/ ├── apple_music.py # core library (cURL parsing, API calls, export logic) ├── cli.py # CLI (--curl-file, file from .env, or curl.txt) ├── app.py # Streamlit web UI ├── curl.example.txt # minimal cURL shape (copy to curl.txt) ├── pyproject.toml ├── .gitignore ├── LICENSE └── README.md MIT — see LICENSE.

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →