8000 GitHub - Blain354/AutoYt2mp3: An automated system for searching and downloading music from text files containing song names. Β· GitHub
[go: up one dir, main page]

Skip to content

About

An automated system for searching and downloading music from text files containing song names.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Auto Get Tunes 🎡

An automated system for searching and downloading music from text files containing song names.

πŸ“‹ Table of Contents

✨ Features

  • 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

πŸ”§ Prerequisites

Required Software

  • Python 3.7+ (tested with Python 3.9+)
  • Google Chrome (for web automation)
  • Windows (for batch script, but Python scripts work on Linux/Mac)

Recommended Knowledge

  • Basic command line usage
  • Understanding of text and JSON files

πŸš€ Installation

1. Clone the project

git clone https://github.com/Blain354/AutoYt2mp3.git
cd auto-get-tunes

2. Install Python and pip

Download Python from python.org if not already installed.

3. Install Python dependencies

pip install selenium webdriver-manager tqdm

4. Verify Chrome installation

Make sure Google Chrome is installed on your system. The script will automatically download the appropriate ChromeDriver.

πŸ“ Project Structure

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

βš™οΈ Configuration

Modifiable parameters in code/conversion.py:

  • BASE_URL: Conversion site (default: y2mate.nu)
  • HEADLESS: Headless mode for Chrome (default: True)
  • PAGE_LOAD_TIMEOUT: Page loading timeout

Modifiable parameters in code/update_db_from_txt.py:

  • Config.timeout: Timeout for YouTube searches
  • Config.pause_between_queries: Delay between searches

🎯 Usage

Simple Method (Recommended)

1. Prepare your songs file

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

2. Run the main script

process_tunes.bat "my_songs.txt" "C:\Music\MyProject"

The script will:

  1. Search each song on YouTube
  2. Detect and report duplicates
  3. Automatically download new songs
  4. Organize files in the specified folder

Individual Scripts Usage

YouTube search only

cd code
python update_db_from_txt.py "my_songs.txt"

Download only

cd code
python conversion.py "C:\Music\MyProject"

πŸ—„οΈ Database

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)

Example entry:

{
  "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"
}

πŸ“ Examples

Example 1: First project

# Create my_songs.txt file with your favorite songs
process_tunes.bat "my_songs.txt" "C:\Music\Favorites"

Example 2: Add songs to existing project

# Create new_songs.txt with new songs
process_tunes.bat "new_songs.txt" "C
7747
:\Music\Favorites"
# Duplicates will be automatically detected

Example 3: Specific project

process_tunes.bat "workout_playlist.txt" "C:\Music\Workout"

πŸ”§ Troubleshooting

Common Issues

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

Frequent Error Messages

  • [ERROR] File 'xxx' does not exist: Check input file path
  • Timeout: 'Download' button not found: Network issue or site temporarily unavailable
  • Empty database: Normal on first run, DB will be created automatically

🀝 Contributing

Contributions are welcome! To contribute:

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Possible Improvement Areas

  • Support for other platforms (Spotify, SoundCloud)
  • Graphical user interface
  • Linux/Mac support for main script
  • Playlist management
  • Audio quality filters

⚠️ Legal Disclaimers

  • 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

πŸ“„ Disclaimer

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

About

An automated system for searching and downloading music from text files containing song names.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0