Skip to content

Instantly share code, notes, and snippets.

View Mugichoko445's full-sized avatar

Shohei Mori Mugichoko445

View GitHub Profile
@Mugichoko445
Mugichoko445 / gdrive_download.sh
Last active June 8, 2022 21:58 — forked from guysmoilov/gdrive_download.sh
Bash script to download large zip files from google drive while confirming the virus scan warning
#!/bin/sh
# Usage: bash gdrive_download your_gdrive_id output.zip
# Note: You can find your_gdrive_id in the middle of a URL >> https://drive.google.com/open?id=your_gdrive_id&authuser=0
CONFIRM=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://drive.google.com/uc?export=download&id=$1" -O- | sed -En 's/.*confirm=([0-9A-Za-z_]+).*/\1/p')
wget --load-cookies /tmp/cookies.txt "https://drive.google.com/uc?export=download&confirm=$CONFIRM&id=$1" -O $2
rm -f /tmp/cookies.txt