Comparing version 0.0.5 to 0.0.6
@@ -15,3 +15,3 @@ // src/Downloader.ts | ||
import readline from "readline"; | ||
console.log('çalıştı apoı') | ||
console.log('Başlatılıyor... RecodedBy: Ic3zy') | ||
function removeParenthesizedText(s) { | ||
@@ -102,13 +102,6 @@ const regex = /\s*([[(][^[\]()]*[\])])\s*/g; | ||
async fetchAlbumArt(url) { | ||
return axios.get(url, { responseType: "arraybuffer" }).then((response) => Buffer.from(response.data, "binary")).catch(() => { | ||
throw new YtdlMp3Error("Failed to fetch album art from endpoint: " + url); | ||
}); | ||
return axios.get(url, { responseType: "arraybuffer" }).then((response) => Buffer.from(response.data, "binary")).catch(() => {}); | ||
} | ||
async fetchResults() { | ||
const response = await axios.get(this.url.href).catch((error) => { | ||
if (error.response?.status) { | ||
throw new YtdlMp3Error(`Call to iTunes API returned status code ${error.response.status}`); | ||
} | ||
throw new YtdlMp3Error("Call to iTunes API failed and did not return a status"); | ||
}); | ||
const response = await axios.get(this.url.href).catch((error) => {}); | ||
if (response.data.resultCount === 0) { | ||
@@ -155,7 +148,3 @@ throw new YtdlMp3Error("Call to iTunes API did not return any results"); | ||
} | ||
const videoInfo = await ytdl.getInfo(url).catch((error) => { | ||
throw new YtdlMp3Error(`Failed to fetch info for video with URL: ${url}`, { | ||
cause: error | ||
}); | ||
}); | ||
const videoInfo = await ytdl.getInfo(url).catch((error) => {}); | ||
const formatConverter = new FormatConverter(); | ||
@@ -165,7 +154,3 @@ const songTagsSearch = new SongTagsSearch(videoInfo.videoDetails); | ||
console.log('outfilebyapo', outputFile); | ||
const videoData = await this.downloadVideo(videoInfo).catch((error) => { | ||
throw new YtdlMp3Error("Failed to download video", { | ||
cause: error | ||
}); | ||
}); | ||
const videoData = await this.downloadVideo(videoInfo).catch((error) => {}); | ||
formatConverter.videoToAudio(videoData, outputFile); | ||
@@ -179,3 +164,2 @@ if (this.getTags) { | ||
} | ||
/** Returns the content from the video as a buffer */ | ||
async downloadVideo(videoInfo) { | ||
@@ -196,3 +180,2 @@ const buffers = []; | ||
} | ||
/** Returns the absolute path to the audio file to be downloaded */ | ||
getOutputFile(videoTitle) { | ||
@@ -209,2 +192,1 @@ const baseFileName = removeParenthesizedText(videoTitle).replace(/[^a-z0-9]/gi, "_").split("_").filter((element) => element).join("_").toLowerCase(); | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "ic3zy-mp3", | ||
"type": "module", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"packageManager": "pnpm@9.3.0", | ||
@@ -6,0 +6,0 @@ "description": "An NPM package to facilitate downloading music from YouTube, including automatic retrieval of ID3 tags and album art via the iTunes public API.", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61807
471