GithubHelp home page GithubHelp logo

lemuelroberto / spotifyplaylist_to_ytmusic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sigma67/spotify_to_ytmusic

1.0 1.0 0.0 177 KB

Clone a Spotify playlist to YouTube Music

License: MIT License

Python 100.00%

spotifyplaylist_to_ytmusic's Introduction

Transfer a Spotify Playlist to YouTube Music

A simple command line script to clone a Spotify playlist to YouTube Music.

  • Transfer a single Spotify playlist
  • Transfer all playlists for a Spotify user

Requirements

  • Python 3.6+ - https://www.python.org
  • Python extensions: pip install -U -r requirements
  • Have made at least one playlist manually on YouTube Music

Setup

  1. Initially you should create a new settings.ini containing your Spotify credentials.

Simply copy settings.ini.example to a new file settings.ini:

$ cp settings.ini.example settings.ini
  1. Generate a new app at https://developer.spotify.com/my-applications

  2. Fill in your client_id and client_secret from your Spotify app

  3. For YouTube Music, open a console in the source code folder and run

python Setup.py youtube

  1. Open your browser and copy your request headers according to the instructions at https://ytmusicapi.readthedocs.io/en/latest/setup.html. Paste them into the terminal to proceed.

This Setup.py procedure stores all credentials locally in the file settings.ini.

Transfer a playlist

After you've created the settings file, you can simply run the script from the command line using:

python YouTube.py <spotifylink>

where <spotifylink> is a link like https://open.spotify.com/user/edmsauce/playlist/3yGp845Tz2duWCORALQHFO Alternatively you can also use a file name in place of a spotify link. The file should contain one song per line.

The script will log its progress and output songs that were not found in YouTube Music to noresults.txt.

Transfer all playlists of a Spotify user

For migration purposes, it is possible to transfer all public playlists of a user by using the Spotify user's ID (unique username).

python YouTube.py --all <spotifyuserid>

Command line options

There are some additional command line options for setting the playlist name and determining whether it's public or not. To view them, run

> python YouTube.py -h

Arguments:

positional arguments:
  playlist              Provide a playlist Spotify link. Alternatively,
                        provide a text file (one song per line)

optional arguments:
  -h, --help            show this help message and exit
  -u UPDATE, --update UPDATE
                        Delete all entries in the provided YouTube Music
                        playlist and update the playlist with entries from the
                        Spotify playlist.
  -n NAME, --name NAME  Provide a name for the YouTube Music playlist.
                        Default: Spotify playlist name
  -i INFO, --info INFO  Provide description information for the YouTube
                        Music Playlist. Default: Spotify playlist description
  -d, --date            Append the current date to the playlist name
  -p, --public          Make the playlist public. Default: private
  -r, --remove          Remove playlists with specified regex pattern.
  -a, --all             Transfer all public playlists of the specified user
                        (Spotify User ID).

spotifyplaylist_to_ytmusic's People

Contributors

rolln-dev avatar sigma67 avatar lmagasweran-sc avatar tgrrr avatar demesm avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar

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.