Catatan Harian Mas Andri

Silahkan digunakan dengan bijaksana

back

Cara Download File Google Drive Menggunakan WGET

21 Mei 2020 || 23:12:30 WIB || ClassyID

Ini buat catatan saja biar gak lupa :

format wgetnya seperti ini : 

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\n/p')&id=FILEID" -O FILENAME && rm -rf /tmp/cookies.txt

Contoh link google drive

https://drive.google.com/file/d/10FW4NTleYI-og2o6tMDPueIx7QqmzkQQ/view?usp=sharing

Maka yg jadi FILEID = 10FW4NTleYI-og2o6tMDPueIx7QqmzkQQ

FILENAME = diisi sesuai nama file beserta ekstensinya (contoh film.mp4)

Jadi nanti WGET nya seperti ini :

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=10FW4NTleYI-og2o6tMDPueIx7QqmzkQQ' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=10FW4NTleYI-og2o6tMDPueIx7QqmzkQQ" -O film.mp4 && rm -rf /tmp/cookies.txt

Semoga berguna

Sumber