From bee196abc4557a87c67ef58ac5470a6cc65b21f3 Mon Sep 17 00:00:00 2001 From: Ali Afsharzadeh Date: Fri, 13 Dec 2024 12:46:12 +0330 Subject: [PATCH] Allow download videos from direct links --- src/helpers/downloadUrl.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/helpers/downloadUrl.ts b/src/helpers/downloadUrl.ts index 33f1868..0630e91 100644 --- a/src/helpers/downloadUrl.ts +++ b/src/helpers/downloadUrl.ts @@ -37,7 +37,7 @@ export default async function downloadUrl( noPlaylist: true, format: downloadJob.audio ? 'bestaudio[filesize<=2G]/bestaudio[filesize_approx<=2G]/[filesize<=2G]/[filesize_approx<=2G]' - : '[filesize<=2G][ext=mp4]/[filesize_approx<=2G][ext=mp4]/[filesize<=2G]/[filesize_approx<=2G]', + : '[filesize<=2G][ext=mp4]/[filesize_approx<=2G][ext=mp4]/[filesize<=2G]/[filesize_approx<=2G]/best', maxFilesize: '2048m', noCallHome: true, noProgress: true, @@ -94,7 +94,8 @@ export default async function downloadUrl( if (error.message.includes('Unsupported URL')) { downloadJob.status = DownloadJobStatus.unsupportedUrl } else if ( - error.message.includes('Requested format is not available') + error.message.includes('Requested format is not available') || + error.message.includes('File is larger than max-filesize') ) { downloadJob.status = DownloadJobStatus.noSuitableVideoSize } else {