Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

codeIntrovert/Musician

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

Repository files navigation

Spotify to YouTube Music Downloader

A Python script that allows you to download songs from YouTube based on a Spotify playlist. The script maintains metadata and album art from Spotify while downloading the audio from YouTube.

Features

  • Download songs from YouTube using Spotify playlist links
  • Preserve song metadata (artist, album, title)
  • Embed album art from Spotify
  • Automatic YouTube search and download
  • Progress tracking during downloads

Prerequisites

  • Python 3.7 or higher
  • pip (Python package installer)
  • Spotify Developer Account

Installation

  1. Clone or download this repository to your local machine

  2. Set up Spotify API credentials:

    • Go to Spotify Developer Dashboard
    • Log in with your Spotify account
    • Click "Create App"
    • Fill in the app details (name and description)
    • Accept the terms and conditions
    • Once created, you'll see your Client ID and Client Secret
    • Click "Edit Settings"
    • Add http://localhost:8888/callback to the Redirect URIs
    • Save the changes
  3. Create a .env file in the root directory:

    # Copy the sample file
    cp .env.sample .env

    Then edit the .env file and add your credentials:

    SPOTIFY_CLIENT_ID=your_client_id_here
    SPOTIFY_CLIENT_SECRET=your_client_secret_here
    
  4. Install the required dependencies:

    pip install -r requirements.txt

Usage

  1. Run the script:

    python soptify.py
  2. When prompted, enter your Spotify playlist URL

    • The URL should be in the format: https://open.spotify.com/playlist/...
  3. The script will:

    • Fetch all tracks from your Spotify playlist
    • Search for each song on YouTube
    • Download the audio
    • Embed metadata and album art
    • Save the files in a music folder

Output

  • Downloaded songs will be saved in the ./music/ directory
  • Files are saved in M4A format with embedded metadata and album art
  • Progress is shown in the terminal during download

Note

This tool is for personal use only. Please respect copyright laws and terms of service of both Spotify and YouTube.

Dependencies

  • pytubefix: YouTube video downloading
  • python-dotenv: Environment variable management
  • mutagen: Audio metadata handling
  • requests: HTTP requests for album art

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /