mirror of
https://github.com/glomatico/gamdl.git
synced 2026-06-13 04:05:14 +03:00
dc82f3579638d380168cf640d919a60f85d82ab3
Glomatico's ✨ Apple Music ✨ Downloader
A Python script to download Apple Music songs/music videos/albums/playlists.
This is a rework of https://github.com/Slyyxp/AppleMusic-Downloader/tree/a6e18de8da4694219924affaa2b5686930e39e84.
Some new features that I added:
- MP4Box for muxing
- Tags for music videos
- Multiple URLs input
- iTunes folder structure
- Embedded lyrics and .lrc file
- Auto set region
- Playlist support
- And much more!
Setup
- Install Python 3.8 or higher
- Install the required packages using pip:
pip install -r requirements.txt
- Add MP4Box and mp4decrypt to your PATH
- You can get them from here:
- MP4Box: https://gpac.wp.imt.fr/downloads/
- mp4decrypt: https://www.bento4.com/downloads/
- Or you can use the ones I provided and add them to your PATH or put them on the same folder as the script:
- MP4Box (Windows): https://drive.google.com/open?id=1o202Kese9Q4dKzzgEtZnznuUx_eJp0bH
- mp4decrypt (Windows): https://drive.google.com/open?id=1K6Y98zSfHowALq4FJ6MYrhg1oFBltci9
- MP4Box (Linux): https://drive.google.com/open?id=1rgEkkmsDnzF3SECEpyxz3m-EuJzUj182
- mp4decrypt (Linux): https://drive.google.com/open?id=16qZfStVibIGgH3xSKmAE1Wuf17DTDR8q
- You can get them from here:
- Create a folder called
loginon the same folder as the script and put yourcookies.txtandtoken.txtfiles there- You can get your cookies by using this Google Chrome extension on Apple Music website: https://chrome.google.com/webstore/detail/cookies-txt/njabckikapfpffapmjgojcnbfjonfjfg. Make sure to export it as
cookies.txtand put it on theloginfolder as described above. - You can get your token by looking at the network requests on Apple Music website.
- On Google Chrome, you can do this by pressing F12 on Apple Music website then clicking on the
Networktab. Then, start navigating throught Apple Music website, filter the requests byamp-apiand click on one that hasauthorizationon theRequest Headerssection. Copy the value of theauthorizationheader, paste it on a text file and save it astoken.txton theloginfolder.
- On Google Chrome, you can do this by pressing F12 on Apple Music website then clicking on the
- If you have previously used the old version of this script, you can just copy your
cookies.txtandtoken.txtfiles from the old version to theloginfolder. You will have to addBearerbefore your token on thetoken.txtfile.
- You can get your cookies by using this Google Chrome extension on Apple Music website: https://chrome.google.com/webstore/detail/cookies-txt/njabckikapfpffapmjgojcnbfjonfjfg. Make sure to export it as
- Put your L3 CDM (
device_client_id_blobanddevice_private_keyfiles) onpywidevine/L3/cdm/devicesfolder- You can get your L3 CDM by using wvdumper: https://github.com/wvdumper/dumper
Usage
python gamdl.py [OPTIONS] [URLS]
Languages
Python
100%
