-
-
Save rokibhasansagar/2f9c241ec6a16acb7a76053281a34d5c to your computer and use it in GitHub Desktop.
Revisions
-
shawnli87 revised this gist
May 20, 2023 . 1 changed file with 43 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 @@ -1,23 +1,60 @@ #!/bin/bash url="$1" #prompt for url if not provided until [ ! -z "$url" ] ; do read -p "url=" url done id=$(sed 's|.*gofile.io/d/||g' <<< "$url") echo "Downloading $id" #get guest account token for url and cookie token=$(curl -s 'https://api.gofile.io/createAccount' | jq -r '.data.token' 2>/dev/null) [ "$?" -ne 0 ] && echo "Creating guest account failed, please try again later" #get website token for url websiteToken=$(curl -s 'https://gofile.io/dist/js/alljs.js' | grep websiteToken | awk '{ print $3 }' | jq -r) [ "$?" -ne 0 ] && echo "Getting website token failed, please try again later" #get content info from api resp=$(curl 'https://api.gofile.io/getContent?contentId='"$id"'&token='"$token"'&websiteToken='"$websiteToken"'&cache=true' 2>/dev/null) code="$?" #prompt for password if required if [[ $(jq -r '.status' <<< "$resp" 2>/dev/null) == "error-passwordRequired" ]] ; then until [ ! -z "$password" ] ; do read -p "password=" password password=$(printf "$password" | sha256sum | cut -d' ' -f1) resp=$(curl 'https://api.gofile.io/getContent?contentId='"$id"'&token='"$token"'&websiteToken='"$websiteToken"'&cache=true&password='"$password" 2>/dev/null) code="$?" done fi #verify content info was retrieved successfully [ "$code" -ne 0 ] && echo "URL unreachable, check provided link" && exit 1 #create download folder mkdir "$id" 2>/dev/null cd "$id" #load the page once so download links don't get redirected curl -H 'Cookie: accountToken='"$token" "$url" -o /dev/null 2>/dev/null [ "$?" -ne 0 ] && echo "Loading page failed, check provided link" for i in $(jq '.data.contents | keys | .[]' <<< "$resp"); do name=$(jq -r '.data.contents['"$i"'].name' <<< "$resp") url=$(jq -r '.data.contents['"$i"'].link' <<< "$resp") #download file if not already downloaded if [ ! -f "$name" ] ; then echo echo "Downloading $name" curl -H 'Cookie: accountToken='"$token" "$url" -o "$name" [ "$?" -ne 0 ] && echo "Downloading ""$filename"" failed, please try again later" && rm "$filename" fi done echo -
shawnli87 revised this gist
Aug 25, 2022 . 1 changed file with 3 additions and 8 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,26 +6,21 @@ echo "Downloading $id" #get guest account token for url and cookie token=$(curl -s 'https://api.gofile.io/createAccount' | jq -r '.data.token' 2>/dev/null) #get content info from api resp=$(curl 'https://api.gofile.io/getContent?contentId='"$id"'&token='"$token"'&websiteToken=12345&cache=true' 2>/dev/null) #load the page once so download links don't get redirected curl -H 'Cookie: accountToken='"$token" "$1" -o /dev/null 2>/dev/null for i in $(jq '.data.contents | keys | .[]' <<< "$resp"); do name=$(jq -r '.data.contents['"$i"'].name' <<< "$resp") url=$(jq -r '.data.contents['"$i"'].link' <<< "$resp") echo echo "Downloading $name" curl -H 'Cookie: accountToken='"$token" "$url" -o "$name" done echo echo echo "Note: gofile.io is entirely free with no ads," echo "you can support it at https://gofile.io/donate" -
shawnli87 revised this gist
Aug 23, 2022 . 1 changed file with 20 additions and 10 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 @@ -1,20 +1,30 @@ #!/bin/bash id=$(sed 's|.*gofile.io/d/||g' <<< "$1") echo "Downloading $id" #get guest account token for url and cookie token=$(curl -s 'https://api.gofile.io/createAccount' | jq -r '.data.token' 2>/dev/null) #create temporary cookie with guest account token echo '.gofile.io TRUE / TRUE 0 accountToken '"$token" > .cookies #get content info from api resp=$(curl 'https://api.gofile.io/getContent?contentId='"$id"'&token='"$token"'&websiteToken=12345&cache=true' 2>/dev/null) #load the page once so download links don't get redirected curl -L -b .cookies "$url" -o /dev/null 2>/dev/null for i in $(jq '.data.contents | keys | .[]' <<< "$resp"); do name=$(jq -r '.data.contents['"$i"'].name' <<< "$resp") url=$(jq -r '.data.contents['"$i"'].link' <<< "$resp") echo echo "Downloading $name" curl -L -b .cookies $url -o "$name" done rm .cookies echo echo echo "Note: gofile.io is entirely free with no ads," -
MCOfficer revised this gist
Oct 14, 2020 . 1 changed file with 2 additions and 2 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 @@ -3,8 +3,8 @@ id=`sed -E 's/.*gofile.io\/d\/(\w*?)/\1/' <<< $1` echo "Downloading $id" server=`curl -s https://apiv2.gofile.io/getServer?c=$id | jq -r '.data.server'` files=`curl -s https://$server.gofile.io/getUpload?c=$id | jq '.data.files'` for key in `jq 'keys | .[]' <<< $files`; do file=`jq ".[$key]" <<< $files` -
MCOfficer revised this gist
Oct 14, 2020 . 1 changed file with 1 addition and 1 deletion.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 @@ -3,7 +3,7 @@ id=`sed -E 's/.*gofile.io\/d\/(\w*?)/\1/' <<< $1` echo "Downloading $id" info=`curl -s https://srv-store5.gofile.io/getUpload?c=$id` files=`jq '.data.files' <<< $info` for key in `jq 'keys | .[]' <<< $files`; do -
MCOfficer created this gist
Oct 14, 2020 .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,21 @@ #!/bin/bash id=`sed -E 's/.*gofile.io\/d\/(\w*?)/\1/' <<< $1` echo "Downloading $id" info=`curl -s https://srv-store5.gofile.io/getUpload?c=$id | jq -c` files=`jq '.data.files' <<< $info` for key in `jq 'keys | .[]' <<< $files`; do file=`jq ".[$key]" <<< $files` url=`jq -r '.link' <<< $file` name=`jq -r '.name' <<< $file` echo echo "Downloading $name" curl $url -o "$name" done echo echo echo "Note: gofile.io is entirely free with no ads," echo "you can support it at https://gofile.io/donate"