Forked from vithalreddy/gd-drive-file-download.sh
Created
September 17, 2019 08:20
-
-
Save amjltc295/ae8420b96b75920514d773a5a324f199 to your computer and use it in GitHub Desktop.
Shell Script To Download Google Drive Files from terminal
This file contains 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
#!/bin/bash | |
read -p "Enter File Id: " fileid | |
read -e -p "Enter File Dir: " "path_to_download_dir" dir #replce with your download dir path ~/Downloads | |
cd ~/$dir | |
echo "File will be downloaded in dir: ~/{$dir}" | |
curl -c ./$fileid -s -L "https://drive.google.com/uc?export=download&id=${fileid}" > /dev/null | |
curl -Lb ./$fileid "https://drive.google.com/uc?export=download&confirm=`awk \ | |
'/download/ {print $NF}' \ | |
./$fileid`&id=${fileid}" -O -J -L | |
if [ -f ./$fileid ] ; then | |
rm -rf ./$fileid | |
echo "cookie file deleted successfully" | |
fi | |
echo "File downloaded in dir: ~/{$dir}" |
Author
amjltc295
commented
Oct 7, 2019
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment