Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fetch = require("node-fetch")
- async function spotipai(url) {
- const trackResponse = await fetch(`https://api.fabdl.com/spotify/get?url=${encodeURIComponent(url)}`, {
- headers: {
- 'Accept': 'application/json, text/plain, */*',
- 'User-Agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36',
- 'Referer': 'https://spodownloader.com/'
- }
- });
- const trackData = await trackResponse.json();
- const trackId = trackData.result.id;
- const gid = trackData.result.gid;
- const taskResponse = await fetch(`https://api.fabdl.com/spotify/mp3-convert-task/${gid}/${trackId}`, {
- headers: {
- 'Accept': 'application/json, text/plain, */*'
- }
- });
- const taskData = await taskResponse.json();
- const tid = taskData.result.tid;
- const progressResponse = await fetch(`https://api.fabdl.com/spotify/mp3-convert-progress/${tid}`, {
- headers: {
- 'Accept': 'application/json, text/plain, */*',
- 'User-Agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36',
- 'Referer': 'https://spodownloader.com/'
- }
- });
- const progressData = await progressResponse.json();
- return {
- trackInfo: trackData.result,
- downloadUrl: `https://api.fabdl.com${progressData.result.download_url}`
- };
- }
- //use
- const spotify = await spotipai("https://open.spotify.com/track/4ePs7pCU6Jc82Vp8xwVo6g");
- console.log(JSON.stringify(spotify, null, 2));
Advertisement