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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

79d355e · Mar 6, 2025

History

36 Commits
Mar 6, 2025
Feb 16, 2025
Feb 16, 2025
Feb 16, 2025
Mar 6, 2025
Mar 6, 2025
Feb 16, 2025
Mar 6, 2025
Feb 16, 2025
Feb 16, 2025

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