Skip to content

Commit

Permalink
Fixed error handling
Browse files Browse the repository at this point in the history
Updated libraries
Updated binaries
  • Loading branch information
BERNARDO31P committed Jun 22, 2024
1 parent c61dd76 commit a0ac2cb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
14 changes: 11 additions & 3 deletions app/assets/js/lib/filter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let keywords = [
const keywordsYt = [
"\\[.*\\]",
"\\{.*\\}",
"\\([A-Za-z]{2}\\)",
Expand All @@ -25,6 +25,14 @@ let keywords = [
"\"",
"'"
];
let ytFilter = new RegExp(keywords.join("|"), 'gi');

export {ytFilter};
const keywordsErrors = [
"winerror 10054",
"aes-cbc",
"[youtube]"
];

const ytFilter = new RegExp(keywordsYt.join("|"), 'gi');
const errorFilter = new RegExp(keywordsErrors.join("|"), 'gi');

export {ytFilter, errorFilter};
5 changes: 3 additions & 2 deletions app/assets/js/tools.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import mustache from "./lib/mustache.min.js";
import {ytFilter} from "./lib/filter.js";
import {errorFilter, ytFilter} from "./lib/filter.js";

const terminate = require("terminate");
const path = require("path");
Expand Down Expand Up @@ -659,8 +659,9 @@ function downloadURL(mode, location, url, percentage, codecAudio, codecVideo, qu
if (!aborted) {
data = data.toLowerCase();

if (!data.includes("winerror 10054") && !data.includes("aes-cbc"))
if (!data.match(errorFilter)) {
error = true;
}

if (data.includes("winerror 3")) resolve("drive");
if (data.includes("permission")) resolve("permission");
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fastdownloader",
"version": "0.5.15",
"version": "0.5.16",
"description": "A fast video and audio downloader for YouTube",
"main": "main.js",
"scripts": {
Expand All @@ -26,17 +26,17 @@
"author": "Bernardo de Oliveira <[email protected]>",
"license": "GPL-3.0",
"devDependencies": {
"@electron/asar": "^3.2.8",
"electron": "^28.1.0",
"electron-builder": "^24.9.1"
"@electron/asar": "^3.2.10",
"electron": "^31.0.2",
"electron-builder": "^24.13.3"
},
"dependencies": {
"auto-launch": "^5.0.6",
"electron-updater": "^6.1.7",
"electron-updater": "^6.2.1",
"fastest-levenshtein": "^1.0.16",
"node-youtube-music": "^0.8.3",
"terminate": "^2.6.1",
"youtube-sr": "^4.3.10",
"youtube-sr": "^4.3.11",
"ytpl": "^2.3.0"
},
"build": {
Expand Down
Binary file modified resources/yt-dlp_linux
Binary file not shown.

0 comments on commit a0ac2cb

Please sign in to comment.