update gdrivedl()
This commit is contained in:
parent
6a15c81069
commit
7694d6bd6f
|
@ -617,10 +617,16 @@ gdrivedl() {
|
|||
|
||||
local _ID=$1
|
||||
local _FILENAME=$2
|
||||
if [[ -z "$XDG_DOWNLOAD_DIR" ]]; then
|
||||
mkdir $HOME/Downloads
|
||||
local _XDG_DOWNLOAD_DIR="$HOME/Downloads"
|
||||
else
|
||||
local _XDG_DOWNLOAD_DIR="$XDG_DOWNLOAD_DIR"
|
||||
fi
|
||||
wget --prefer-family=IPv4 --force-directories --no-check-certificate --no-hsts --continue --load-cookies "/tmp/gdrive-cookies-${_ID}.txt" \
|
||||
"https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/gdrive-cookies-${_ID}.txt \
|
||||
--keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=${_ID}' -O- | \
|
||||
sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=${_ID}" -O "${XDG_DOWNLOAD_DIR}/$_FILENAME" \
|
||||
sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=${_ID}" -O "${_XDG_DOWNLOAD_DIR}/$_FILENAME" \
|
||||
&& rm -rf "/tmp/gdrive-cookies-${_ID}.txt"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue