Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

wget file from google drive

# download_gdrive.sh
#!/bin/bash

FILEID=$1
FILENAME=$2

# Files bigger than 100MB
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id='${FILEID} -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/1
/p')&id=${FILEID}" -O $FILENAME && rm -rf /tmp/cookies.txt

$ > download_gdrive.sh $GOOGLE_DRIVE_FILEID $OUTPUT_FILE_NAME
Source by pcx3.com #
 
PREVIOUS NEXT
Tagged: #wget #file #google #drive
ADD COMMENT
Topic
Name
5+5 =