Code Monkey home page Code Monkey logo

youtube-music-importer's Introduction

YouTube Music Playlist Importer

A Python utility to automatically create and update playlists on YouTube Music using CSV files.

Description

This tool was made for taking exported CSVs from Spotify and being able to ingest them into Youtube Music. But, it should work for just about any CSV formatted music list. It does depend on the ytmusicapi library, which is a third party library. I have no affiliation with the author of that library.

Prerequisites

  • Python 3.x
  • A oauth.json file containing credentials for the YouTube Music API. To generate this file, follow the authentication steps provided in the ytmusicapi documentation.

Installation

  1. Clone the repository:
git clone https://github.com/bcherb2/youtube-music-importer.git yt-music-importer
  1. Change directory into the cloned repository:
cd yt-music-importer
  1. Install the required Python packages:
pip install ytmusicapi

Usage

  1. Prepare your CSV files. Each CSV file should represent one playlist. The script will use the exact filename of the CSV to become (or update) the playlist. I used Exportify to export my Spotify playlists to CSV.

    To ensure compatibility, make sure you modify the column header variables TRACK_COL and ARTIST_COL in the script to match the column headers of your CSV files.

  2. Place the CSV files in the same directory as the script.

  3. Run the script:

python add.py
  1. The script will iterate over each CSV file, creating or updating the corresponding playlist on YouTube Music with the tracks specified in the CSV.

If everything worked as intended, you should see something like this:

    >python .\add.py
    Successfully added 'Put Your Hands Up For Detroit - Radio Edit' by Fedde Le Grand to playlist 'test'.
    Successfully added 'Innocence' by NERO to playlist 'test'.
    Successfully added 'Pressure - Alesso Remix' by Nadia Ali,Starkillers,Alex Kenji,Alesso to playlist 'test'.

Error Handling

The script implements error handling mechanisms like retrying on rate limit errors and exponential backoff; you may need to adjust if you run into issues.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.