An automated system for searching and downloading music from text files containing song names.
- Features
- Prerequisites
- Installation
- Project Structure
- Configuration
- Usage
- Database
- Examples
- Troubleshooting
- Contributing
- Disclaimer
- Automatic YouTube Search: Automatically finds song URLs on YouTube
- Smart Duplicate Detection: Prevents duplicate downloads based on YouTube video ID
- Centralized Database: Manages all entries in a persistent JSON file
- Automatic Download: Converts and downloads songs in MP3 format
- Progress Bar: Real-time progress display with remaining time estimation
- Project Management: Organizes downloads by project folder
- Simple Interface: Windows batch script for easy use
- Python 3.7+ (tested with Python 3.9+)
- Google Chrome (for web automation)
- Windows (for batch script, but Python scripts work on Linux/Mac)
- Basic command line usage
- Understanding of text and JSON files
git clone https://github.com/Blain354/AutoYt2mp3.git
cd auto-get-tunesDownload Python from python.org if not already installed.
pip install selenium webdriver-manager tqdmMake sure Google Chrome is installed on your system. The script will automatically download the appropriate ChromeDriver.
auto-get-tunes/
βββ code/
β βββ update_db_from_txt.py # YouTube search and DB update
β βββ conversion.py # Download and conversion
β βββ tunes_database.json # Centralized database
βββ example/
β βββ tunes.txt # Example input file
β βββ downloads/ # Example downloads folder
βββ process_tunes.bat # Main script (Windows)
βββ manage_database.py # Database management utility
βββ README.md # This file
BASE_URL: Conversion site (default: y2mate.nu)HEADLESS: Headless mode for Chrome (default: True)PAGE_LOAD_TIMEOUT: Page loading timeout
Config.timeout: Timeout for YouTube searchesConfig.pause_between_queries: Delay between searches
Create a text file (e.g., my_songs.txt) with one song per line:
Shape of You, Ed Sheeran
Blinding Lights, The Weeknd
Watermelon Sugar, Harry Styles
process_tunes.bat "my_songs.txt" "C:\Music\MyProject"The script will:
- Search each song on YouTube
- Detect and report duplicates
- Automatically download new songs
- Organize files in the specified folder
cd code
python update_db_from_txt.py "my_songs.txt"cd code
python conversion.py "C:\Music\MyProject"The database (code/tunes_database.json) stores:
- title: Song name
- url: YouTube URL found
- done: Download status (true/false/"timeout")
- download_path: Download folder used
- project: Project name (to be filled manually)
{
"title": "Shape of You, Ed Sheeran",
"url": "https://www.youtube.com/watch?v=JGwWNGJdvx8",
"done": true,
"download_path": "C:\\Music\\MyProject",
"project": "Summer Playlist 2025"
}# Create my_songs.txt file with your favorite songs
process_tunes.bat "my_songs.txt" "C:\Music\Favorites"# Create new_songs.txt with new songs
process_tunes.bat "new_songs.txt" "C
7747
:\Music\Favorites"
# Duplicates will be automatically detectedprocess_tunes.bat "workout_playlist.txt" "C:\Music\Workout"Chrome/ChromeDriver
- Script automatically downloads ChromeDriver
- If issues: verify Chrome is installed and up to date
YouTube Timeouts
- Some searches may fail (marked as "timeout")
- Re-run the script: only unprocessed entries will be retried
File Permissions
- Check write permissions in destination folder
- Run as administrator if necessary
Python Dependencies
# Reinstall dependencies
pip install --upgrade selenium webdriver-manager tqdm[ERROR] File 'xxx' does not exist: Check input file pathTimeout: 'Download' button not found: Network issue or site temporarily unavailableEmpty database: Normal on first run, DB will be created automatically
Contributions are welcome! To contribute:
- Fork the project
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Support for other platforms (Spotify, SoundCloud)
- Graphical user interface
- Linux/Mac support for main script
- Playlist management
- Audio quality filters
- Respect copyright and terms of use of platforms
- Use only for personal purposes
- Downloading copyrighted content may be illegal in your jurisdiction
- Authors are not responsible for the use of this tool
This project was primarily developed by Claude Sonnet 4 (Anthropic's AI assistant) under the coordination and supervision of Guillaume Blain.
The code was generated, tested, and refined through human-machine collaboration, demonstrating current AI capabilities for software development. All features were designed and validated by Guillaume Blain to meet real automation needs.
Development: Claude Sonnet 4 (Anthropic)
Coordination & Supervision: Guillaume Blain
Version: 1.0
Last Update: September 2025