Skip to content

hacktivist211/BeatHarvest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

BeatHarvest

A high-quality music downloader that fetches tracks from a Spotify album or playlist and downloads the best matching audio using yt-dlp and Spotipy.

Overview

This project allows you to:

  • Input a Spotify album or playlist URL.
  • Retrieve detailed track information from Spotify.
  • Search and download the best matching audio from YouTube.
  • Output audio in FLAC format with advanced postprocessing options.

Features

  • Spotify Integration: Retrieve album or playlist data using Spotify’s API.
  • YouTube Search & Download: Leverage yt-dlp to search for and download high-quality audio.
  • Custom Audio Conversion: Converts audio files to FLAC using FFmpeg with user-specified settings.

Requirements

1. Create a Virtual Environment (Recommended)

Set up a virtual environment to manage your project’s dependencies:

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

2. Install the Dependencies

Create a requirements.txt file (if it doesn't exist) with the following content:

echo "yt-dlp" > requirements.txt
echo "spotipy" >> requirements.txt

Then install the dependencies:

pip install -r requirements.txt

3. Obtain Spotify Credentials

The script requires Spotify API credentials to retrieve track data. To obtain these credentials, follow these steps:

  1. Visit the Spotify Developer Dashboard.

  2. Log in with your Spotify account.

  3. Click on "Create an App".

  4. Fill in the App Name and App Description, then agree to the terms.

  5. Once your app is created, you will see the Client ID and Client Secret.

  6. Open the file spotify_version_Download_High_quality_songs.py and replace the placeholders:

    SPOTIFY_CLIENT_ID = 'ENTER_SPOTIFY_CLIENT_ID'
    SPOTIFY_CLIENT_SECRET = 'ENTER_SPOTIFY_CLIENT_SECRET'

    with your actual Client ID and Client Secret.

4. Install FFmpeg

Ensure that FFmpeg is installed and available in your system's PATH:

  • Download FFmpeg from ffmpeg.org/download.html.
  • Follow the installation instructions for your operating system.
  • Verify the installation by running:
ffmpeg -version

5. Running the Script

To run the Spotify downloader script, execute the following command in your terminal:

python BeatHarvest.py

You will be prompted for:

  • Spotify URL: Enter the URL of the Spotify album or playlist.
  • Output Directory: Specify the folder where the audio files will be saved (or press Enter to use the current directory).

Troubleshooting

  • Spotify API Errors:
    Double-check your Spotify credentials to ensure they are correctly set in the script.

  • yt-dlp Issues:
    Verify that yt-dlp is updated to the latest version.

  • FFmpeg Not Found:
    Confirm that FFmpeg is properly installed and added to your PATH.

  • General Errors:
    If you encounter any other issues, review the error messages in your terminal. They can often provide clues on what might be misconfigured or missing.

Contributing

Contributions are welcome! Feel free to fork the repository and submit pull requests. For major changes, please open an issue first to discuss your ideas.

About

A high-quality music downloader that fetches Spotify playlists/albums and downloads the best matching audio using yt-dlp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages