Skip to content

Instantly share code, notes, and snippets.

@davzaman
Created December 16, 2020 22:34
Show Gist options
  • Select an option

  • Save davzaman/25b1488c8d1255f23fb4db4f20d0dfc4 to your computer and use it in GitHub Desktop.

Select an option

Save davzaman/25b1488c8d1255f23fb4db4f20d0dfc4 to your computer and use it in GitHub Desktop.

Revisions

  1. davzaman created this gist Dec 16, 2020.
    9 changes: 9 additions & 0 deletions download_from_gdrive.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #!/bin/bash
    # Reference: https://stackoverflow.com/a/48133859/1888794
    # fileid is the part of the link to the artifact: https://drive.google.com/file/d/<FILEID>/view?
    FILEID=$1
    FILENAME=$2

    curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=${FILEID}" > /dev/null
    curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=${FILEID}" -o ${FILENAME}
    rm cookie