Skip to content

Commit

Permalink
Updated binaries
Browse files Browse the repository at this point in the history
Updated error catching
Removed deprecated and non-working code
  • Loading branch information
BERNARDO31P committed Dec 2, 2024
1 parent fc29d92 commit f483731
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 104 deletions.
1 change: 1 addition & 0 deletions app/assets/db/language.ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"noClipboard": "الحافظة فارغة",
"noValidURL": "لم يتم تحديد رابط صالح",
"brokenURL": "يتم دعم هذا الموقع ، ولكن هناك مشكلة حالياً",
"login": "من فضلك افتح متصفحك وقم بتسجيل الدخول إلى YouTube",
"urlInList": "هذا الرابط موجود بالفعل في القائمة",
"urlAdded": "تمت إضافة الرابط إلى القائمة",
"urlsAdded": "تمت إضافة الروابط إلى القائمة",
Expand Down
5 changes: 3 additions & 2 deletions app/assets/db/language.bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"noClipboard": "ক্লিপবোর্ডে কিছুই নেই",
"noValidURL": "কোনও বৈধ URL নির্দিষ্ট করা হয়নি",
"brokenURL": "এই ওয়েবসাইটটি সমর্থিত, তবে বর্তমানে একটি সমস্যা রয়েছে",
"login": "অনুগ্রহ করে আপনার ব্রাউজার খুলুন এবং YouTube এ লগইন করুন",
"urlInList": "এই URL ইতিমধ্যেই তালিকায় রয়েছে",
"urlAdded": "URL তালিকায় যোগ করা হয়েছে",
"urlsAdded": "URL গুলি তালিকায় যোগ করা হয়েছে",
Expand All @@ -80,8 +81,8 @@
"network": "বর্তমানে কোনও ইন্টারনেট সংযোগ নেই",
"songsDownloaded": "সমস্ত গান সফলভাবে ডাউনলোড হয়েছে",
"downloadAborted": "ডাউনলোড সফলভাবে বাতিল করা হয়েছে",
"newVersion": "সংস্করণ XXX উপলব্ধ এবং এটি ডাউনলোড করা হবে",
"updateDownloaded": "আপডেট ডাউনলোড হয়েছে। পরিবর্তনগুলি প্রয়োগ করতে অ্যাপ্লিকেশনটি পুনরায় চালু করুন",
"newVersion": "সংস্করণ XXX উপলব্ধ এবং এটি ডাউনলোড করা হবে",
"updateDownloaded": "আপডেট ডাউনলোড হয়েছে। পরিবর্তনগুলি প্রয়োগ করতে অ্যাপ্লিকেশনটি পুনরায় চালু করুন",
"settingsSaved": "সেটিংস সংরক্ষণ করা হয়েছে",
"settingsAborted": "সেটিংস সংরক্ষণ বাতিল করা হয়েছে",
"saveLocationEnabled": "শেষ ব্যবহার করা সংগ্রহস্থল স্থানটি স্বয়ংক্রিয়ভাবে যোগ করা হবে",
Expand Down
1 change: 1 addition & 0 deletions app/assets/db/language.de.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"noClipboard": "In der Zwischenablage befindet sich nichts",
"noValidURL": "Sie haben keinen gültigen Link angegeben",
"brokenURL": "Diese Webseite wird unterstützt, jedoch besteht zurzeit ein Problem",
"login": "Bitte öffnen Sie Ihren Browser und melden Sie sich bei YouTube an",
"urlInList": "Dieser Link befindet sich bereits in der Liste",
"urlAdded": "Link wurde zur Liste hinzugefügt",
"urlsAdded": "Links wurden zur Liste hinzugefügt",
Expand Down
1 change: 1 addition & 0 deletions app/assets/db/language.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"noClipboard": "El portapapeles está vacío",
"noValidURL": "No se especificó una URL válida",
"brokenURL": "Este sitio web está soportado, pero actualmente hay un problema",
"login": "Por favor abra su navegador e inicie sesión en YouTube",
"urlInList": "Esta URL ya está en la lista",
"urlAdded": "URL añadida a la lista",
"urlsAdded": "URLs añadidas a la lista",
Expand Down
1 change: 1 addition & 0 deletions app/assets/db/language.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"noClipboard": "Le presse-papiers est vide",
"noValidURL": "Aucune URL valide spécifiée",
"brokenURL": "Ce site est pris en charge, mais il y a actuellement un problème",
"login": "Veuillez ouvrir votre navigateur et vous connecter à YouTube",
"urlInList": "Cette URL est déjà dans la liste",
"urlAdded": "URL ajoutée à la liste",
"urlsAdded": "URLs ajoutées à la liste",
Expand Down
1 change: 1 addition & 0 deletions app/assets/db/language.hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"noClipboard": "क्लिपबोर्ड में कुछ भी नहीं है",
"noValidURL": "कोई मान्य लिंक निर्दिष्ट नहीं है",
"brokenURL": "इस वेबसाइट का समर्थन किया गया है, लेकिन वर्तमान में एक समस्या है",
"login": "कृपया अपना ब्राउज़र खोलें और YouTube में लॉगिन करें",
"urlInList": "यह लिंक पहले से ही सूची में है",
"urlAdded": "लिंक को सूची में जोड़ा गया",
"urlsAdded": "लिंक्स को सूची में जोड़ा गया",
Expand Down
1 change: 1 addition & 0 deletions app/assets/db/language.id.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"noClipboard": "Tidak ada yang ada di clipboard",
"noValidURL": "Tidak ada URL yang valid yang ditentukan",
"brokenURL": "Situs web ini didukung, tetapi saat ini ada masalah",
"login": "Silakan buka browser Anda dan masuk ke YouTube",
"urlInList": "URL ini sudah ada di daftar",
"urlAdded": "URL ditambahkan ke daftar",
"urlsAdded": "URL ditambahkan ke daftar",
Expand Down
1 change: 1 addition & 0 deletions app/assets/db/language.it.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"noClipboard": "La clipboard è vuota",
"noValidURL": "Nessun URL valido specificato",
"brokenURL": "Questo sito web è supportato, ma al momento c'è un problema",
"login": "Per favore apra il suo browser ed effettui l'accesso a YouTube",
"urlInList": "Questo URL è già nell'elenco",
"urlAdded": "URL aggiunto all'elenco",
"urlsAdded": "URL aggiunti all'elenco",
Expand Down
1 change: 1 addition & 0 deletions app/assets/db/language.ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"noClipboard": "クリップボードに何もありません",
"noValidURL": "有効なリンクが指定されていません",
"brokenURL": "このウェブサイトはサポートされていますが、現在問題があります",
"login": "ブラウザを開いてYouTubeにログインしてください",
"urlInList": "このリンクは既にリストにあります",
"urlAdded": "リンクがリストに追加されました",
"urlsAdded": "リンクがリストに追加されました",
Expand Down
1 change: 1 addition & 0 deletions app/assets/db/language.ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"noClipboard": "클립보드에 아무것도 없습니다",
"noValidURL": "유효한 URL이 지정되지 않았습니다",
"brokenURL": "이 웹사이트는 지원되지만 현재 문제가 있습니다",
"login": "브라우저를 열고 YouTube에 로그인하세요",
"urlInList": "이 URL은 이미 목록에 있습니다",
"urlAdded": "URL이 목록에 추가되었습니다",
"urlsAdded": "URL이 목록에 추가되었습니다",
Expand Down
1 change: 1 addition & 0 deletions app/assets/db/language.nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"noClipboard": "Klembord is leeg",
"noValidURL": "Geen geldige URL opgegeven",
"brokenURL": "Deze website wordt ondersteund, maar er is momenteel een probleem",
"login": "Open alstublieft uw browser en log in op YouTube",
"urlInList": "Deze URL staat al in de lijst",
"urlAdded": "URL aan de lijst toegevoegd",
"urlsAdded": "URLs aan de lijst toegevoegd",
Expand Down
1 change: 1 addition & 0 deletions app/assets/db/language.pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"noClipboard": "O clipboard está vazio",
"noValidURL": "Nenhum URL válido especificado",
"brokenURL": "Este site é suportado, mas atualmente há um problema",
"login": "Por favor abra seu navegador e faça login no YouTube",
"urlInList": "Este URL já está na lista",
"urlAdded": "URL adicionado à lista",
"urlsAdded": "URLs adicionados à lista",
Expand Down
1 change: 1 addition & 0 deletions app/assets/db/language.ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"noClipboard": "В буфере обмена ничего нет",
"noValidURL": "Указан неверный URL",
"brokenURL": "Этот сайт поддерживается, но в настоящее время возникла проблема",
"login": "Пожалуйста откройте ваш браузер и войдите в YouTube",
"urlInList": "Этот URL уже в списке",
"urlAdded": "URL добавлен в список",
"urlsAdded": "URL-ы добавлены в список",
Expand Down
1 change: 1 addition & 0 deletions app/assets/db/language.tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"noClipboard": "Panoda hiçbir şey yok",
"noValidURL": "Geçerli bir bağlantı belirtilmedi",
"brokenURL": "Bu web sitesi destekleniyor, ancak şu anda bir sorun var",
"login": "Lütfen tarayıcınızı açın ve YouTubea giriş yapın",
"urlInList": "Bu bağlantı zaten listede",
"urlAdded": "Bağlantı listeye eklendi",
"urlsAdded": "Bağlantılar listeye eklendi",
Expand Down
1 change: 1 addition & 0 deletions app/assets/db/language.zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"noClipboard": "剪贴板中没有任何内容",
"noValidURL": "未指定有效链接",
"brokenURL": "这个网站受支持,但目前存在一个问题",
"login": "请打开您的浏览器并登录到YouTube",
"urlInList": "该链接已在列表中",
"urlAdded": "链接已添加到列表",
"urlsAdded": "链接已添加到列表",
Expand Down
33 changes: 25 additions & 8 deletions app/assets/js/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,16 +283,20 @@ async function download(data) {
i++;
break;
case "permission":
showNotification(languageDB["js"]["permission"], languageDB["js"]["error"], 10000);
showNotification(languageDB["js"]["permission"], languageDB["js"]["error"], 8000);
await sleep(10000);
break;
case "network":
showNotification(languageDB["js"]["network"], languageDB["js"]["error"], 10000);
showNotification(languageDB["js"]["network"], languageDB["js"]["error"], 8000);
await sleep(10000);
break;
case "drive":
await sleep(1000);
break;
case "login":
showNotification(languageDB["js"]["login"], languageDB["js"]["error"], 8000);
await sleep(10000);
break;
default:
exitLoop = true;
}
Expand Down Expand Up @@ -618,22 +622,30 @@ function downloadURL(mode, location, url, percentage, codecAudio, codecVideo, qu
const progressTotalInfo = document.querySelector(".progress-total .info p");
const progressSong = document.querySelector(".progress-song progress");
const progressSongInfo = document.querySelector(".progress-song .info p");

let songInfoError = "";
let songInfo = {};
let title = "";
try {
const output = spawnSync(ytDl + " --print artist,title --skip-download --no-call-home " + url, {
shell: true
}).stdout.toString().split("\n");
songInfo = {artist: output[0], title: output[1]};
});

songInfoError = output.stderr.toString().toLowerCase();

const outputString = output.stdout.toString().split("\n");

songInfo = {artist: outputString[0], title: outputString[1]};
title = clearTitle(songInfo, mode);
} catch (error) {
error = error.toString().toLowerCase();
if (error.includes("getaddrinfo failed")) resolve("network");
if (songInfoError.includes("getaddrinfo failed")) resolve("network");
if (songInfoError.includes("sign in")) resolve("login");

return;
}

if (aborted) resolve("aborted");

const title = clearTitle(songInfo, mode);
console.debug(title);

let config = [
Expand Down Expand Up @@ -662,7 +674,11 @@ function downloadURL(mode, location, url, percentage, codecAudio, codecVideo, qu
let premium = JSON.parse(getCookie("premium"));
if (premium && premium.check) {
if (premium.browser && premium.browser.length) {
config.push("--cookies-from-browser " + premium.browser);
if (process.platform !== "win32" || premium.browser !== "chrome") {
config.push("--cookies-from-browser " + premium.browser);
} else {
console.warn("Chrome is currently not supported on Windows for extracting cookies, continuing");
}
} else {
showNotification(languageDB["js"]["noBrowser"]);
resolve(null);
Expand Down Expand Up @@ -704,6 +720,7 @@ function downloadURL(mode, location, url, percentage, codecAudio, codecVideo, qu
if (data.includes("winerror 3")) resolve("drive");
if (data.includes("permission") || data.includes("cookie")) resolve("permission");
if (data.includes("getaddrinfo failed") || data.includes("timed out")) resolve("network");
if (data.includes("sign in")) resolve("login");
}
});

Expand Down
18 changes: 5 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fastdownloader",
"version": "0.5.22",
"version": "0.5.23",
"description": "A fast YouTube video/audio downloader in electron.js (and many more websites)",
"main": "main.js",
"scripts": {
Expand All @@ -26,13 +26,13 @@
"author": "Bernardo de Oliveira <[email protected]>",
"license": "GPL-3.0",
"devDependencies": {
"@electron/asar": "3.2.10",
"electron": "31.4.0",
"electron-builder": "24.13.3"
"@electron/asar": "3.2.17",
"electron": "33.2.1",
"electron-builder": "25.1.8"
},
"dependencies": {
"auto-launch": "5.0.6",
"electron-updater": "6.2.1",
"electron-updater": "6.3.9",
"fastest-levenshtein": "1.0.16",
"node-youtube-music": "0.8.3",
"terminate": "2.8.0",
Expand Down Expand Up @@ -72,10 +72,6 @@
{
"from": "resources/icons/64x64.png",
"to": "icons/64x64.png"
},
{
"from": "resources/yt-dlp-plugins/seproDev/yt_dlp_plugins/postprocessor/chrome_cookie_unlock.py",
"to": "yt-dlp-plugins/seproDev/yt_dlp_plugins/postprocessor/chrome_cookie_unlock.py"
}
]
},
Expand Down Expand Up @@ -110,10 +106,6 @@
{
"from": "resources/icons/64x64.png",
"to": "icons/64x64.png"
},
{
"from": "resources/yt-dlp-plugins/seproDev/yt_dlp_plugins/postprocessor/chrome_cookie_unlock.py",
"to": "yt-dlp-plugins/seproDev/yt_dlp_plugins/postprocessor/chrome_cookie_unlock.py"
}
]
}
Expand Down

This file was deleted.

0 comments on commit f483731

Please sign in to comment.