Skip to content

Instantly share code, notes, and snippets.

@stiwardjherikofcr
Created October 15, 2022 23:26
Show Gist options
  • Save stiwardjherikofcr/57e4a8e98dd6c5d6f1dbfc08631669bc to your computer and use it in GitHub Desktop.
Save stiwardjherikofcr/57e4a8e98dd6c5d6f1dbfc08631669bc to your computer and use it in GitHub Desktop.
Wget/cURL Large File from Google Drive
#! /bin/bash
# Get files from Google Drive
# $1 = file ID
# $2 = file name
URL="https://docs.google.com/uc?export=download&id=$1"
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 $URL -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=$1" -O $2 && rm -rf /tmp/cookies.txt
# chmod +x download-gdrive.sh
# ./download-gdrive.sh <file ID> <filename>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment