]> zdv2.bktei.com Git - BK-2020-03.git/commitdiff
feat(user/bkytpldl-generic):Reference external javascript solver
authorSteven Baltakatei Sandoval <baltakatei@gmail.com>
Fri, 6 Feb 2026 16:19:15 +0000 (16:19 +0000)
committerSteven Baltakatei Sandoval <baltakatei@gmail.com>
Fri, 6 Feb 2026 16:19:15 +0000 (16:19 +0000)
- Note: external javascript solver required as of 2026 https://github.com/yt-dlp/yt-dlp/issues/14404
- feat(user/bkytpldl-generic):Add 24-hour timeout

user/bkytpldl-generic

index 4f6689ff72cf89abf0b1f495729e53af2339c61c..199ed40b4aca233b016f0b284315bebccaf02f99 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 # Desc: Download YouTube videos
 # Usage: $ ./bkytpldl-generic
-# Version: 4.1.2
+# Version: 4.2.0
 
 declare -a args; # array for yt-dlp arguments
 declare -a urls urls_rand; # array for YouTube playlist URLs
@@ -22,6 +22,10 @@ if ! command -v yt-dlp 1>/dev/random 2>&1; then die "FATAL:yt-dlp not found."; f
 # Donʼt run multiple yt-dlp instances
 if pgrep "^yt-dlp$" 1>/dev/random 2>&1; then die "FATAL:yt-dlp already running."; fi;
 
+# Enable JavaScript solver via deno. See https://github.com/yt-dlp/yt-dlp/wiki/EJS#step-2-install-ejs-challenge-solver-scripts
+args+=("--remote-components");
+args+=("ejs:npm");
+
 # Check directories
 if [[ ! -d $dir_out ]]; then mkdir -p "$dir_out"; fi;
 
@@ -101,7 +105,7 @@ pushd "$dir_out" || die "FATAL:Failed to change pwd to:dir_out:$dir_out";
 # == Download videos ==
 
 #yell "DEBUG:args:$(declare -p args)";  # debug command
-must yt-dlp "${args[@]}";  # execute command
+timeout "$((1*24*3600))" yt-dlp "${args[@]}";
 popd || die "FATAL:Failed to return from dir_out:$dir_out";
 
 # Author: Steven Baltakatei Sandoval