소스 검색

Restore MD5 check as the API returns it again

Effectively partially reverts 06cf71f7
master
JustAnotherArchivist 2 년 전
부모
커밋
8c612082b6
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. +5
    -2
      gofile.io-dl

+ 5
- 2
gofile.io-dl 파일 보기

@@ -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

불러오는 중...
취소
저장