Coder Social home page Coder Social logo

tubeify's Introduction

Tubeify

Scrapes track lists in YouTube video descriptions and adds the songs to a Spotify playlist if matches are found. Made with compilation videos in mind.

Example

The video https://www.youtube.com/watch?v=_EopQtSVZQY has a video description that contains the track list:

0:00 Seven Lions, Last Heroes & HALIENE - Don't Wanna Fall
3:22 Nurko feat. RØRY - Better of Lonely
7:26 Soar & Nytrix - Illuminate
11:53 Last Heroes - Love Like Us (feat. RUNN)
15:23 ADVENT - Last Mistake (feat. Akacia)
18:28 Yetep & RUNN - Alright
21:25 NIKAI - Rain Inside (feat. Nomeli)
24:45 Sabai - Memories (feat. Claire Ridgely)
27:29 Seven Lions - Only Now (Feat. Tyler Graves) [MitiS Remix]

This app will try to find a track list such as this and parse it into a list of artist(s) and song names. It will then try to search Spotify for the scraped tracks and if it finds a match, add the tracks to the provided Spotify playlist.

Setup

YouTube Authentication

  • Create or open an existing Google Cloud project you own.
  • Search for YouTube Data API v3 (it's under API & Services) and click the Enable button.
  • Click the Manage button that replaced the Enable button if the page did not redirect you automatically.
  • You should be on an overview dashboard page for YouTube Data API v3. Click the Credentials item on the left side menu.
  • Click + Create Credentials in the top menu and select API Key. Copy the API key.
  • Paste in the API key in a .env file for this project, or an environment variable named YOUTUBE_API_KEY. See below.

Spotify Authentication

  • Log in to the Spotify Developer Dashboard: https://developer.spotify.com/dashboard/
  • Create a new app
  • Copy the Client ID and paste it into your .env file (see below).
  • Click the Show Client Secret button and copy & paste it into the .env file.
  • Click the Edit Settings button and under Redirect URIs, add http://localhost:8080

Local Environment

  • Create a .env file
YOUTUBE_API_KEY=your_key
SPOTIFY_CLIENT_ID=your_id
SPOTIFY_CLIENT_SECRET=your_secret
  • Optional: Create a Makefile for convenience:
scrape:
	go run ./main.go \
		-youtube-video-id your_video_id \
		-spotify-playlist-id your_playlist_id

Running

  • With the environment variables set up, run the app with go run main.go or make scrape

Resources

Spotify

YouTube

tubeify's People

Contributors

eaardal avatar

Watchers

 avatar  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.