Skip to content

A stable, updated and powerful music library with support for Spotify and YouTube.

License

Notifications You must be signed in to change notification settings

GamesTwoLife/melodify

Repository files navigation

Melodify

A stable, updated and powerful music library with support for Spotify and YouTube.

npm Github Stars GitHub issues NPM

Installation

To install melodify, use npm:

npm install @gamestwolife/melodify

Example

import { Melodify, LoadType } from "@gamestwolife/melodify";

const clientId = "your-client-id";
const clientSecret = "your-client-secret";
const apiKey = "your-youtube-api-key";

(async() => {
	const melodify = new Melodify({
		spotifyClientId: clientId,
		spotifyClientSecret: clientSecret
		youtubeApiKey: apiKey
	});
	
	const search = await melodify.searchProvider.search("Never Gonna Give You Up");

	switch (search.loadType) {
		case LoadType.SEARCH:
			{
				const trackName = `${search.data.tracks.items[0].artists.map(artist => artist.name).join(", ")} - ${search.data.tracks.items[0].name}`;
				console.log(`[${search.loadType}] Track "${trackName}" downloading...`);

				const filePath = await melodify.downloadTrack(trackName);
				console.log(filePath);
			}
			break;
	}
})()

Code made with ❤ by @gamestwolife (GamesTwoLife)

About

A stable, updated and powerful music library with support for Spotify and YouTube.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published