diff options
| author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-04-29 20:45:38 +0200 | 
|---|---|---|
| committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-04-29 20:45:38 +0200 | 
| commit | 179582b4187f5cc9ab784d8ec20b42db4bf12281 (patch) | |
| tree | 1d3ace6462608c7f52cd1757077a7650eca958bc /config | |
| parent | e5ace8442db315dc7a777315c9c7d61ddc6bc194 (diff) | |
Add gdown function
Diffstat (limited to 'config')
| -rw-r--r-- | config/essentials/shell/functions.sh | 8 | 
1 files changed, 8 insertions, 0 deletions
diff --git a/config/essentials/shell/functions.sh b/config/essentials/shell/functions.sh index 250d049..17bf8c4 100644 --- a/config/essentials/shell/functions.sh +++ b/config/essentials/shell/functions.sh @@ -292,3 +292,11 @@ edit_in_dir() {  	[ -f "$file" ] || return 1  	$EDITOR "$file"  } + +# Download a file from google drive +# link like this: https://drive.usercontent.google.com/download?id=1TiJDEftTtF1KTMBI950Bj487ndYqkwpQ&export=download +gdown () { +        agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/12$(head /dev/urandom | tr -dc '0-1' | cut -c1).0.0.0 Safari/537.36" +        uuid=$(curl -sL "$1" -A "$agent" | sed -nE 's|.*(uuid=[^"]*)".*|\1|p') +        aria2c -x16 -s16 "$1&confirm=t&$uuid" -U "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" --summary-interval=0 -d "${2:-.}" +}  | 
