Skip to content

Instantly share code, notes, and snippets.

@thegreatestminer
Last active November 15, 2020 22:00
Show Gist options
  • Save thegreatestminer/78cf9aa7b33e7a0e9908c959d20de8b4 to your computer and use it in GitHub Desktop.
Save thegreatestminer/78cf9aa7b33e7a0e9908c959d20de8b4 to your computer and use it in GitHub Desktop.
google drive download bash alias, by @beliys & @vladalive | gdl <fileid> <filename>
function gdl () {
CONFIRM=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=$1" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$CONFIRM&id=$1" -O $2
rm -rf /tmp/cookies.txt
}
function rcl {
rclone copy "last:Music/$1" "$1" -P
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment