Revisions
-
allenyllee revised this gist
Nov 10, 2017 . 1 changed file with 8 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ if [ "${SOURCE}" == "" ]; then exit 1 fi DEST="$2" #if [ "${DEST}" == "" ]; then # echo "Must specify a destination filename" # exit 1 @@ -20,7 +20,12 @@ CODE=$(wget --save-cookies $COOKIES --keep-session-cookies --no-check-certificat # cleanup the code, format is 'Code: XXXX' CODE=$(echo $CODE | rev | cut -d: -f1 | rev | xargs) # if no $DEST, auto fetch filename, otherwise use $DEST as filename if [ -z "$DEST" ]; then # option --content-disposition to auto fetch filename wget --content-disposition --load-cookies $COOKIES "https://docs.google.com/uc?export=download&confirm=${CODE}&id=${FILEID}" else wget --load-cookies $COOKIES "https://docs.google.com/uc?export=download&confirm=${CODE}&id=${FILEID}" -O $DEST fi rm -f $COOKIES -
allenyllee revised this gist
Nov 10, 2017 . 1 changed file with 7 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,11 +6,11 @@ if [ "${SOURCE}" == "" ]; then exit 1 fi #DEST="$2" #if [ "${DEST}" == "" ]; then # echo "Must specify a destination filename" # exit 1 #fi FILEID=$(echo $SOURCE | rev | cut -d= -f1 | rev) COOKIES=$(mktemp) @@ -20,6 +20,7 @@ CODE=$(wget --save-cookies $COOKIES --keep-session-cookies --no-check-certificat # cleanup the code, format is 'Code: XXXX' CODE=$(echo $CODE | rev | cut -d: -f1 | rev | xargs) # option --content-disposition to auto fetch filename wget --content-disposition --load-cookies $COOKIES "https://docs.google.com/uc?export=download&confirm=${CODE}&id=${FILEID}" #-O $DEST rm -f $COOKIES -
ppetraki created this gist
Nov 8, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ #!/bin/bash SOURCE="$1" if [ "${SOURCE}" == "" ]; then echo "Must specify a source url" exit 1 fi DEST="$2" if [ "${DEST}" == "" ]; then echo "Must specify a destination filename" exit 1 fi FILEID=$(echo $SOURCE | rev | cut -d= -f1 | rev) COOKIES=$(mktemp) CODE=$(wget --save-cookies $COOKIES --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') # cleanup the code, format is 'Code: XXXX' CODE=$(echo $CODE | rev | cut -d: -f1 | rev | xargs) wget --load-cookies $COOKIES "https://docs.google.com/uc?export=download&confirm=${CODE}&id=${FILEID}" -O $DEST rm -f $COOKIES