Simple project that fetches the tracks in a spotify playlist, searches them one by one on YT and adds them to a YT Music Playlist.
- Create a project on google cloud console to get the secrets. Also create a dev account for spotify to get those secrets too.
- Clone the repo
git clone https://github.com/srihariash999/playlist_syncer.git
-
Install NPM packages using bun (recommended)
bun install
-
If you don't want to use bun, use npm
npm install
-
Copy the contents from
sample.env
to a new file named.env
and place it at the root of the project. -
Replace the default values filled in the file with real Ids and Secrets. Project can use either youtube's search API to search for a track or can use a webscraping method (which can save API quota costing). Using offical is recommended and the variable
useUnofficial
determines which is used. This variable having value "0" makes use of official search API and value "1" will use unofficial(web scraping) method. -
Run the program using bun:
bun src/index.ts
Or usign ts-node:
ts-node src/index.ts
Or using nodemon:
nodemon src/index.ts
If you have general question about the project. Feel free to open an issue regarding your query/issue.