Skip to content

Latest commit

 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpotifyPlaylist Alpha

A .NET console app that reads tracks from a Spotify playlist, searches for the matching songs on YouTube, creates a YouTube playlist, and adds the matched videos to it.

Features

  • Reads playlist tracks from Spotify
  • Searches YouTube for each song and artist
  • Creates a new YouTube playlist
  • Adds the first matching YouTube result for each track
  • Uses environment variables for API credentials

Requirements

  • .NET 6 SDK
  • Spotify Developer application credentials
  • Google Cloud project with the YouTube Data API enabled
  • OAuth client secret JSON file for YouTube access

Setup

Clone the repository:

git clone https://github.com/benbop/SpotifyPlaylist-alpha.git
cd SpotifyPlaylist-alpha

Set the required environment variables:

export SPOTIFY_CLIENT_ID="your_spotify_client_id"
export SPOTIFY_CLIENT_SECRET="your_spotify_client_secret"
export YOUTUBE_CLIENT_SECRET_PATH="/path/to/client_secret.json"

On Windows PowerShell:

$env:SPOTIFY_CLIENT_ID="your_spotify_client_id"
$env:SPOTIFY_CLIENT_SECRET="your_spotify_client_secret"
$env:YOUTUBE_CLIENT_SECRET_PATH="C:\path\to\client_secret.json"

Before running, update SpotifyApiCalls.cs and replace YOUR_PLAYLIST_ID with the Spotify playlist ID you want to copy. You can also change the generated YouTube playlist title in YoutubeApiCalls.cs.

Running

dotnet run --project SpotifyPlaylist-alpha

The first run opens the Google OAuth flow so the app can create and update a playlist on your YouTube account.

Project Structure

  • Program.cs - application entry point
  • SpotifyApiCalls.cs - Spotify authentication and playlist track loading
  • YoutubeApiCalls.cs - YouTube OAuth, playlist creation, search, and inserts

License

MIT

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages