Convert Apple Music songs to MP3.
Project description
Apple Music Playlist to YouTube Audio Downloader
Description
This Python tool allows you to extract song titles and artist names from public Apple Music playlists, search for the corresponding audio on YouTube, and download the audio files as MP3s using the yt-dlp library.
The script is designed to automate this process efficiently and includes a progress bar for clear visibility into the operations.
Disclaimer: Downloading copyrighted audio or video content from YouTube may violate its terms of service. This tool is intended for educational purposes only, and I am not responsible for any misuse.
Features
- Fetches song and artist details from Apple Music playlists.
- Searches YouTube for matching audio content (e.g., "Official Audio").
- Downloads the audio and saves it in MP3 format.
- Provides a progress bar for each step of the process.
- Includes error handling and logging for a smooth user experience.
Requirements
- Python 3.7+
- FFmpeg: Required for audio extraction when using
yt-dlp. - Required Python libraries:
requestsbeautifulsoup4tqdmyt-dlplogging
Install FFmpeg
Ensure FFmpeg is installed and added to your system PATH.
- On MacOS:
brew install ffmpeg - On Ubuntu/Debian:
sudo apt install ffmpeg - On Windows: Download FFmpeg, extract it, and add the bin folder to your system PATH.
Installation
-
Clone this repository:
git clone https://github.com/yourusername/apple-music-youtube-downloader.git cd apple-music-youtube-downloader
-
Install required libraries:
pip install -r requirements.txt
Usage
Run the script with a valid Apple Music Playlist URL:
python script.py <Apple Music Playlist URL>
Example:
python script.py https://music.apple.com/us/playlist/replay-2024/pl.example123
Output:
- Audio files will be downloaded as MP3s into the
outputfolder. - Progress will be displayed for fetching data, searching YouTube, and downloading audio files.
Notes
- The playlist must be public for the script to fetch data successfully.
- Ensure FFmpeg is installed. If it is missing, the script will raise an error.
- Audio files are downloaded in high-quality MP3 format (192 kbps).
Legal Disclaimer
Downloading content from YouTube is against YouTube's terms of service. This tool is provided for educational purposes only. By using this tool, you acknowledge that:
- You are responsible for your own actions.
- The author is not liable for any misuse of this tool.
Please ensure you have the right to download any content before proceeding.
Future Plans
I plan to publish this tool on PyPI to make it easier to install and use:
pip install apple-music-downloader
If you encounter any issues or have feature requests, please open an issue on the GitHub repository.
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests to improve the tool.
License
MIT License
Author
Aidan Friedsam
GitHub: afriedsam
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file applemusicmp3-0.1.0.tar.gz.
File metadata
- Download URL: applemusicmp3-0.1.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
626a2ef649c9b62bcd1fe79d1d7ad1a633e53dc4b036415637482129a0a4ebe6
|
|
| MD5 |
7c1c2844ce40042417c002e86ba94d98
|
|
| BLAKE2b-256 |
36a1d2fba9ca01faa28a56b5895445e53e22b81238e46021b3f516521b898989
|
Provenance
The following attestation bundles were made for applemusicmp3-0.1.0.tar.gz:
Publisher:
python-publish.yml on afriedsam/AppleMusicMP3
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
applemusicmp3-0.1.0.tar.gz -
Subject digest:
626a2ef649c9b62bcd1fe79d1d7ad1a633e53dc4b036415637482129a0a4ebe6 - Sigstore transparency entry: 155905049
- Sigstore integration time:
-
Permalink:
afriedsam/AppleMusicMP3@b49415cf6908850e119b162b18ff1b1f417c6b11 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/afriedsam
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b49415cf6908850e119b162b18ff1b1f417c6b11 -
Trigger Event:
push
-
Statement type:
File details
Details for the file AppleMusicMP3-0.1.0-py3-none-any.whl.
File metadata
- Download URL: AppleMusicMP3-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d7ea60bbb46d2705a86683aff3316ed4441838c2e30b6b07cdaac13e777f95e
|
|
| MD5 |
ed7dd9114169a2dae406d1e65da665e5
|
|
| BLAKE2b-256 |
882f9d809d7b0668c0faf54236a14ff39ccc6797e31ca550373f49a5a58418ef
|
Provenance
The following attestation bundles were made for AppleMusicMP3-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on afriedsam/AppleMusicMP3
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
applemusicmp3-0.1.0-py3-none-any.whl -
Subject digest:
3d7ea60bbb46d2705a86683aff3316ed4441838c2e30b6b07cdaac13e777f95e - Sigstore transparency entry: 155905051
- Sigstore integration time:
-
Permalink:
afriedsam/AppleMusicMP3@b49415cf6908850e119b162b18ff1b1f417c6b11 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/afriedsam
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b49415cf6908850e119b162b18ff1b1f417c6b11 -
Trigger Event:
push
-
Statement type: