Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions network/DownTube/9fc68080.patch
Original file line number Diff line number Diff line change
@@ -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();
});
3 changes: 2 additions & 1 deletion network/DownTube/DownTube.SlackBuild
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -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 {} +
Expand Down