Skip to content

Instantly share code, notes, and snippets.

@avissian
Last active July 1, 2025 10:53
Show Gist options
  • Select an option

  • Save avissian/21fdc360634064ac91a298090fac7ef7 to your computer and use it in GitHub Desktop.

Select an option

Save avissian/21fdc360634064ac91a298090fac7ef7 to your computer and use it in GitHub Desktop.
Download video & upload to own cloud (using rclone)
#!/bin/bash
BASE_CMD="yt-dlp -6 $1 --cookies-from-browser=firefox" # use IPv6 only!
CLOUD_DST="yadisk:/Video_yt"
HTTPS_PROXY= #"socks5://127.0.0.1:7890"
HTTP_PROXY=$HTTPS_PROXY
if [[ $2 == "" ]]
then
$BASE_CMD -F
exit 0
fi
# download
$BASE_CMD -f $2
# upload
while true; do
read -p "Upload? Y/n " -t 120 yn
case $yn in
""|[Yy]* ) rclone move -P "$($BASE_CMD -f $2 --get-filename)" "$CLOUD_DST"; break;;
[Nn]* ) exit;;
* ) echo "Y/n?";;
esac
done # upload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment