Browse Source

Restore MD5 check as the API returns it again

Effectively partially reverts 06cf71f7
master
JustAnotherArchivist 2 years ago
parent
commit
8c612082b6
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      gofile.io-dl

+ 5
- 2
gofile.io-dl View File

@@ -37,8 +37,8 @@ fi

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
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["md5"], f["name"], f["link"])' | \
while read -r size md5 name link
do
if [[ "${name}" == *'/'* || "${link}" == *' '* || ! "${link}" =~ ^https://((srv-)?file[0-9]+|srv-store[0-9]+)\.gofile\.io/download/ ]]
then
@@ -46,6 +46,7 @@ curl -s "${folderUrl}" | python3 -c 'import json,sys; obj = json.loads(sys.stdin
echo "name: ${name}" >&2
echo "link: ${link}" >&2
echo "size: ${size}" >&2
echo "md5: ${md5}" >&2
exit 1
fi

@@ -70,4 +71,6 @@ curl -s "${folderUrl}" | python3 -c 'import json,sys; obj = json.loads(sys.stdin
echo "Size mismatch: expected ${size}, got ${actualSize}" >&2
exit 1
fi

md5sum -c <<<"${md5} ./${name}"
done

Loading…
Cancel
Save