From 1f999cbfbcef46b81a737b92387d205b5439c810 Mon Sep 17 00:00:00 2001 From: Anagnostakis Ioannis Date: Sat, 30 May 2026 12:13:03 +0300 Subject: [PATCH] Add a needed patch Signed-off-by: Anagnostakis Ioannis --- network/DownTube/9fc68080.patch | 80 ++++++++++++++++++++++++++++ network/DownTube/DownTube.SlackBuild | 3 +- 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 network/DownTube/9fc68080.patch diff --git a/network/DownTube/9fc68080.patch b/network/DownTube/9fc68080.patch new file mode 100644 index 00000000000..c03137c7345 --- /dev/null +++ b/network/DownTube/9fc68080.patch @@ -0,0 +1,80 @@ +--- DownTube.mjs.orign 2026-05-30 11:54:37.715238308 +0300 ++++ DownTube.mjs 2026-05-30 12:03:23.378200112 +0300 +@@ -13,8 +13,10 @@ + const isPlaylist = (url) => url.includes("&list="); + const isFullChannel = (url) => url.includes("/channel/") || url.includes("/@"); + +-const ytDlpCommand = (url, mode, quality = '', downloadPath) => { +- let command = "slack-tube "; ++const buildCommand = (url, mode, quality, downloadPath, useAndroidVr) => { ++ let command = useAndroidVr ++ ? 'slack-tube --extractor-args "youtube:player_client=android_vr" ' ++ : 'slack-tube '; + let isSPV = isSingleOrPlaylistVideo(url); + let isPL = isPlaylist(url); + let isFullCH = isFullChannel(url); +@@ -65,15 +67,23 @@ + command = command.replace("%(uploader)s - ", ""); + command = command.replace(".%(ext)s", " - %(uploader)s.%(ext)s"); + } ++ return command; ++}; ++ ++const ytDlpCommand = (url, mode, quality = '', downloadPath, useAndroidVr = true) => { ++ const command = buildCommand(url, mode, quality, downloadPath, useAndroidVr); + + exec(command, (error, stdout, stderr) => { + if (error) { ++ if (useAndroidVr) { ++ console.error('android_vr client failed, retrying with default client...'); ++ ytDlpCommand(url, mode, quality, downloadPath, false); ++ return; ++ } + console.error(`Error: ${error.message}`); + return; + } +- if (stderr) { +- console.error(stderr); +- } ++ if (stderr) console.error(stderr); + console.log(stdout); + }); + }; +@@ -99,29 +109,14 @@ + + rl.question("> ", (mode) => { + switch (mode) { +- case '1': +- ytDlpCommand(url, 'audio', '', downloadPath); +- break; +- case '2': +- ytDlpCommand(url, 'video', '', downloadPath); +- break; +- case '3': +- ytDlpCommand(url, 'video', '2160', downloadPath); +- break; +- case '4': +- ytDlpCommand(url, 'video', '1080', downloadPath); +- break; +- case '5': +- ytDlpCommand(url, 'video', '720', downloadPath); +- break; +- case '6': +- ytDlpCommand(url, 'comments', '', downloadPath); +- break; +- case '7': +- ytDlpCommand(url, 'chat', '', downloadPath); +- break; +- default: +- console.log("Invalid choice."); ++ case '1': ytDlpCommand(url, 'audio', '', downloadPath); break; ++ case '2': ytDlpCommand(url, 'video', '', downloadPath); break; ++ case '3': ytDlpCommand(url, 'video', '2160', downloadPath); break; ++ case '4': ytDlpCommand(url, 'video', '1080', downloadPath); break; ++ case '5': ytDlpCommand(url, 'video', '720', downloadPath); break; ++ case '6': ytDlpCommand(url, 'comments', '', downloadPath); break; ++ case '7': ytDlpCommand(url, 'chat', '', downloadPath); break; ++ default: console.log("Invalid choice."); + } + rl.close(); + }); diff --git a/network/DownTube/DownTube.SlackBuild b/network/DownTube/DownTube.SlackBuild index f0ac77c939d..a9fef0dc131 100644 --- a/network/DownTube/DownTube.SlackBuild +++ b/network/DownTube/DownTube.SlackBuild @@ -13,7 +13,7 @@ PRGNAM=DownTube VERSION=${VERSION:-15.0} _SUBPKG=slack-tube SUBVERSION=514ck.15.0 -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -43,6 +43,7 @@ rm -rf $PRGNAM-src || true mkdir $PRGNAM-src cd $PRGNAM-src tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +patch $PRGNAM.mjs < $CWD/9fc68080.patch || exit chown -R root:root . find . -type f \( -perm -4000 -o -perm -2000 \) -exec chmod -s {} +