π A Python script that downloads audio from SoundCloud or YouTube, splits it into segments, and uses Shazam to identify songs within the mix.
- π§ Download audio from SoundCloud or YouTube URLs
- πΌ Identify songs using Shazam API
- πΎ Save results to timestamped text files
This project uses scdl for downloading SoundCloud tracks.
sudo apt install ffmpeg scdl
pip install ShazamApi pydub pytube shazamio
# Install Homebrew if not already installed
# See https://brew.sh for installation instructions
brew install ffmpeg scdl
# Optional: Create and activate virtual environment
# python3.11 -m venv venv && source venv/bin/activate
# If you don't have Python 3.11:
# brew install [email protected]
# Install required packages
pip install shazamio pydub pytube ShazamApi
The script supports three main commands:
python shazam.py download <url>
Downloads audio from YouTube or SoundCloud and processes it for song recognition.
python shazam.py scan
Processes all MP3 files in the Downloads directory.
python shazam.py recognize <file>
Processes a single audio file for song recognition.
Results are saved in the recognised-lists
directory with timestamped filenames in the format:
songs-DDMMYY-HHMMSS.txt
βΉοΈ The generated song list can be imported into TuneMyMusic
- The script splits audio into 1-minute segments for optimal recognition
- Duplicate songs within the same mix are automatically filtered out
- Large files are processed in chunks to manage memory efficiently
Feel free to open issues or submit pull requests with improvements. We welcome contributions from the community!