Browse Source

Fix gofile.io download to the new getFolder endpoint and download server structure

master
JustAnotherArchivist 2 years ago
parent
commit
8554c01a84
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      gofile.io-dl

+ 4
- 3
gofile.io-dl View File

@@ -35,11 +35,12 @@ else
code="${url##*/}"
fi

printurl "https://apiv2.gofile.io/getUpload?c=${code}"
curl -s "https://apiv2.gofile.io/getUpload?c=${code}" | python3 -c 'import json,sys; obj = json.loads(sys.stdin.read().strip())'$'\n''for f in obj["data"]["files"].values():'$'\n'' print(f["size"], f["name"], f["link"])' | \
folderUrl="https://api.gofile.io/getFolder?folderId=${code}"
printurl "${folderUrl}"
curl -s "${folderUrl}" | python3 -c 'import json,sys; obj = json.loads(sys.stdin.read().strip())'$'\n''for f in obj["data"]["contents"].values():'$'\n'' print(f["size"], f["name"], f["link"])' | \
while read -r size name link
do
if [[ "${name}" == *'/'* || "${link}" == *' '* || ! "${link}" =~ ^https://srv-file[0-9]+\.gofile\.io/download/ ]]
if [[ "${name}" == *'/'* || "${link}" == *' '* || ! "${link}" =~ ^https://((srv-)?file[0-9]+|srv-store[0-9]+)\.gofile\.io/download/ ]]
then
echo 'Cannot download file:' >&2
echo "name: ${name}" >&2


Loading…
Cancel
Save