A Python CLI tool that automates downloading tracks from SoundCloud and importing them into Apple Music on macOS.
The downloaded MP3 files are automatically enriched with SoundCloud metadata (title, artist, album, genre, date) and cover artwork, so Apple Music shows the correct track information after import.
- macOS (Apple Music integration requires macOS)
- Python 3.8+
- yt-dlp (will be installed as dependency)
- Clone or download the project:
git clone https://github.com/zfl4wless/sc2am.git
cd sc2am- Create a virtual environment (recommended):
python3 -m venv venv
source venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Initialize configuration (optional):
python main.py config initThis creates a default config at ~/.sc2am/config.yaml.
SoundCloud-Links must point to a single track, for example:
https://soundcloud.com/artist/track
or https://www.soundcloud.com/artist/track.
Download a single track:
python main.py download "https://soundcloud.com/artist/track"Download and add to playlist:
python main.py download "https://soundcloud.com/artist/track" --playlist "My Playlist"Don't automatically open Music app:
python main.py download "https://soundcloud.com/artist/track" --no-openCreate a file urls.txt with one URL per line:
https://soundcloud.com/artist/track1
https://soundcloud.com/artist/track2
# This is a comment
https://soundcloud.com/artist/track3
Then process all URLs:
python main.py batch urls.txtBatch options:
# Add all tracks to a playlist
python main.py batch urls.txt --playlist "My Playlist"
# Continue processing even if a URL fails
python main.py batch urls.txt --continue-on-errorView current configuration:
python main.py config showConfiguration File (~/.sc2am/config.yaml):
download_dir: ~/Downloads/sc2am
music_library_path: null
default_playlist: null
keep_downloads: true
open_music_app: true
log_level: INFO
log_file: nullEnvironment Variables: Override config file settings with environment variables:
SC2AM_DOWNLOAD_DIR=~/Music/Downloads
SC2AM_PLAYLIST="My Playlist"
SC2AM_LOG_LEVEL=DEBUG
SC2AM_KEEP_DOWNLOADS=false
python main.py download "https://soundcloud.com/artist/track"Configuration Options:
| Option | Type | Default | Description |
|---|---|---|---|
download_dir |
Path | ~/Downloads/sc2am |
Where to download MP3 files |
music_library_path |
Path | auto-detect | Path to Music.app library |
default_playlist |
String | none | Default playlist for imports |
keep_downloads |
Bool | true |
Keep MP3 files after import |
open_music_app |
Bool | true |
Auto-open Music.app |
log_level |
String | INFO |
Logging level |
log_file |
Path | none | Optional log file path |
# Use custom config file
python main.py --config /path/to/config.yaml download "..."
# Set log level
python main.py --log-level DEBUG download "..."Batch download with logging:
python main.py --log-level DEBUG batch urls.txt --continue-on-errorDownload to custom directory:
SC2AM_DOWNLOAD_DIR=~/Music python main.py download "..."- Validate - Checks if the provided URL is from a supported platform
- Download - Uses yt-dlp to download audio as MP3 (192kbps)
- Tag - Embeds title, artist, album/genre/date and cover artwork into the MP3
- Open - Launches Apple Music with the tagged MP3 file
- Add - (Optional) Adds track to specified playlist via AppleScript
pip install yt-dlp --upgrade- Ensure Music.app is installed (comes with macOS)
- Check your
open_music_appsetting in config
- Playlist name must exactly match your Music.app playlists
- Ensure the Music.app is not currently playing (can interfere with AppleScript)
- Check that download directory exists and is writable:
mkdir -p ~/Downloads/sc2am
chmod 755 ~/Downloads/sc2amContributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Make your changes
- Submit a pull request
# Install with dev dependencies
pip install -r requirements-dev.txt
# Code formatting
black sc2am/
# Linting
flake8 sc2am/MIT License - see LICENSE file for details
- This tool is for personal use to manage legally acquired music
- Respect copyright laws in your jurisdiction
- SoundCloud's terms of service should be respected
For issues, feature requests, or questions:
- Open an issue on GitHub
- Check existing issues first