A Selenium-based bot to automatically delete songs from your Apple Music library via the web interface.
Watch a video tutorial on how to use this bot:
- Deletes all visible songs from your Apple Music library page in bulk
- Logs each deleted song to a CSV file
- Interactive mode: allows you to refresh and repeat deletions
- Python 3.7+
- Selenium (
pip install selenium) - Chromedriver: Download from https://chromedriver.chromium.org/downloads and place the binary at
./chromedriver/chromedriverrelative to this project directory - Chromium-based browser (e.g., Brave, Chrome, Chromium) for best compatibility
- Install Python dependencies:
pip install selenium
- Download Chromedriver:
- Go to Chromedriver downloads
- Download the version matching your browser
- Place the
chromedriverbinary in a folder namedchromedriverin this project directory:./chromedriver/chromedriver
- Install a Chromium-based browser:
- The script is configured for Brave by default. You can change the path in
bot.py(binaryPath). - Chrome or Chromium also work. Update the
binaryPathvariable if needed.
- The script is configured for Brave by default. You can change the path in
- Run the bot:
python bot.py
- To use interactive mode, run:
python -i bot.py
- Manual Apple ID Login Required:
- The bot will open a browser window and navigate to Apple Music.
- You must log in manually due to Apple popups and 2FA (two-factor authentication).
- After logging in and reaching your library, press Enter in the terminal to continue.
- Interactive Deletion:
- The bot will attempt to delete all visible songs on the page.
- It will log each deleted song to
song.csv. - The bot will refresh and repeat until no more songs are found.
- You can stop the bot at any time with
Ctrl+C.
- Apple's web UI may change: This script relies on specific element selectors that may break if Apple updates their site.
- 2FA and popups: The bot cannot bypass Apple's two-factor authentication or popups. Manual login is required each session.
- Browser path: If you use a browser other than Brave, update the
binaryPathinbot.pyaccordingly.
- If the bot cannot find
chromedriver, ensure it is at./chromedriver/chromedriverand is executable. - If the browser does not open, check the
binaryPathinbot.py. - If selectors break, the script may need updating to match Apple's latest web UI.
If you found this project helpful, consider supporting my development contribution! Crypto is strongly preferred, but other options are available:
- Card: Donate via Stripe
- PayPal: paypal.me/tycooperaow
- Bitcoin:
35WJjcwyQTCD6gLwKhxypmmjZDUaYRhLMJ - Ethereum:
0x6bBF37fdBfacBE9C93faC1aF32E12439aCA44475 - Solana:
9mSCuBMNkhWjNvHZNWTU4UMgrsFaEdDxnB8ZkaXtQuz9
Thank you for your support!