Last active
July 30, 2024 14:09
-
-
Save XeonDead/0d48e860a5a936c4af6ac42f2e0acea0 to your computer and use it in GitHub Desktop.
yt-dlp-file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/data/data/com.termux/files/usr/bin/bash | |
function start_ciadpi { | |
~/bin/ciadpi -i 127.0.0.1 -p 10801 -s 1 & | |
export CIADPI_PID=$! | |
export -g extra_args=--proxy 'socks5://127.0.0.1:10801' | |
sleep 2s; | |
} | |
function stop_ciadpi { | |
if [ -n ${CIADPI_PID} ] | |
then kill $CIADPI_PID | |
fi | |
} | |
termux-wake-lock | |
IFS=$'\n' # make newlines the only separator | |
set -f # disable globbing | |
#start_ciadpi | |
while read -r url | |
do | |
if | |
yt-dlp -f "bv[height<=1080][ext=mp4][fps<=120]+ba[ext=m4a]/b" \ | |
--continue --wait-for-video 60-300 \ | |
--sponsorblock-mark all \ | |
--sub-langs 'ru,en' --embed-subs --sub-format best \ | |
--embed-metadata --embed-thumbnail --autonumber-start 1 \ | |
-N 8 --extractor-args "youtube:formats=dashy" \ | |
-R infinite --retry-sleep linear=5:600:15 \ | |
--postprocessor-args Merger+ffmpeg_i1:"-hwaccel auto" \ | |
--cookies ~/youtube.com_cookies.txt \ | |
--exec after_move:"termux-notification -c \"%(channel)S - %(title)S has finished downloading\"" \ | |
-o "~/storage/movies/%(channel)s/%(playlist_autonumber&{} |)s%(title)s.%(ext)s" $extra_args $1 $url | |
then | |
sed -i "/$(echo $url | cut -d'/' -f4)/d" ~/yt-dl.list | |
else | |
# stop_ciadpi | |
termux-wake-unlock && exit 1 | |
fi | |
done < ~/yt-dl.list | |
#stop_ciadpi | |
termux-wake-unlock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment