Code Monkey home page Code Monkey logo

audiohives's Introduction

AudioHives : Spotify Playlist Downloader

This is a Node.js project that allows you to download songs from a Spotify playlist using YouTube as the source. The script uses the Spotify Web API to fetch playlist details, searches for each track on YouTube, and downloads the audio files.

Prerequisites

Before running the script, make sure you have the following installed on your machine:

Installation

  1. Clone this repository to your local machine.
git clone https://github.com/Abhi6722/AudioHives
  1. Change into the project directory.
cd AudioHives
  1. Install the required npm packages.
npm install

Getting Started

  1. Obtain your Spotify API credentials (Client ID and Client Secret) and update them in the config.js file:
// config.js
module.exports = {
    spotify: {
      clientId: 'YOUR_SPOTIFY_CLIENT_ID',
      clientSecret: 'YOUR_SPOTIFY_CLIENT_SECRET',
    },
    youtube: {
      apiKey: 'YOUR_YOUTUBE_API_KEY',
    },
  };

Usage

  1. To start the download process, simply run:
npm start
  1. The script will run the index.js file and then we can open the http://localhost:8888/login and login into our Spotify Account and then after that we can see the Access token in our terminal.
Screenshot 2023-08-06 at 12 59 46 AM
  1. Now we have to copy the access token and paste getMe.js file in the token variable.
const token = "YOUR_GENERATED_ACCESS_TOKEN";
  1. Now we have to run the getMe.js file in another terminal using the command
node getMe.js
  1. The script will fetch the playlist details from Spotify, search for each track on YouTube, and download the audio files. The downloaded songs will be saved in the songs directory.
Screenshot 2023-08-06 at 1 01 16 AM

Notes

  • Make sure you have the required npm packages installed as mentioned in the package.json file.
  • The script will download the audio of the first YouTube search result for each track. If you want to customize this behavior, you can modify the downloadYouTubeVideo function in the youtube.js file.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

This project uses the Spotify Web API and YouTube API to fetch playlist details and download songs, respectively.

Feel free to use, modify, and distribute this project according to the terms of the MIT License. Happy playlist downloading! 🎵🎧

audiohives's People

Contributors

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