Fix format not found [Pinterest]

This commit is contained in:
Sudo Space 2025-04-23 08:25:03 +03:30
parent 9bb6a5501e
commit 19cf9633b1
2 changed files with 3 additions and 17 deletions

View file

@ -12,8 +12,6 @@ class Pinterest extends Ytdlp {
const p = spawn(
[
"yt-dlp",
"-f",
"bv+ba",
"-o",
outPath,
"--downloader",

View file

@ -34,16 +34,8 @@ class Youtube extends Ytdlp {
if (filesize !== "unknown") {
filesizeInMB = parseFloat(filesize);
}
if (
id &&
quality !== "unknown" &&
filesize !== "unknown" &&
filesizeInMB < 1500
) {
if (
!qualitys.has(quality) ||
filesizeInMB < parseFloat(qualitys.get(quality)!.filesize)
) {
if (id && quality !== "unknown" && filesize !== "unknown" && filesizeInMB < 1500) {
if (!qualitys.has(quality) || filesizeInMB < parseFloat(qualitys.get(quality)!.filesize)) {
qualitys.set(quality, { id, quality, filesize });
}
}
@ -52,11 +44,7 @@ class Youtube extends Ytdlp {
}
async downloadVideo(formatId: string) {
const outPath = join(
rootPath(),
"downloads",
`%(title).50s-%(format_id)s.%(ext)s`
);
const outPath = join(rootPath(), "downloads", `%(title).50s-%(format_id)s.%(ext)s`);
this.status = "ACTIVE";
const p = spawn(
[