Skip to content

Instantly share code, notes, and snippets.

@lvzongting
Last active March 30, 2025 08:56
Show Gist options
  • Select an option

  • Save lvzongting/0f367ded8d4adbac3ed06d4d43e8d50d to your computer and use it in GitHub Desktop.

Select an option

Save lvzongting/0f367ded8d4adbac3ed06d4d43e8d50d to your computer and use it in GitHub Desktop.

Revisions

  1. lvzongting revised this gist Apr 25, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions wget-gdrive.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    #reference https://unix.stackexchange.com/questions/136371/how-to-download-a-folder-from-google-drive-using-terminal
    #get cookie and code
    wget --save-cookies 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_]+).*/Code: \1\n/p'

  2. lvzongting created this gist Apr 25, 2017.
    5 changes: 5 additions & 0 deletions wget-gdrive.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    #get cookie and code
    wget --save-cookies 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_]+).*/Code: \1\n/p'

    #download the file
    wget --load-cookies cookies.txt 'https://docs.google.com/uc?export=download&confirm=CODE_FROM_ABOVE&id=FILEID'