# 2024.11.13 - [up_pixeldrain] Add pixeldrain as an upload host
# 2024.11.13 - [mad] Add pixeldrain apikey section to allow pd uploads # 2024.11.13 - [up_filesquid] Add "No password nor allowed IP" response handling
This commit is contained in:
parent
3049b3e305
commit
1e93af9b45
5 changed files with 217 additions and 42 deletions
42
hosts/up_filesquid.sh
Executable file → Normal file
42
hosts/up_filesquid.sh
Executable file → Normal file
|
|
@ -1,6 +1,6 @@
|
|||
#! Name: up_filesquid.sh
|
||||
#! Author: kittykat
|
||||
#! Version: 2024.10.23
|
||||
#! Version: 2024.11.13
|
||||
#! Desc: Add support for uploading files to filesquid.net
|
||||
#! Info: Files are accessible at https://address/f.php?h=<file_code>&p=1
|
||||
#! MaxSize: 5GB
|
||||
|
|
@ -95,18 +95,34 @@ squid_PostFile() {
|
|||
local pline=${7}
|
||||
UploadTicket="${WorkDir}/.flocks/upload_${_hostCode}_${filepath//[^a-zA-Z0-9]/}"
|
||||
echo -e "[${YELLOW}${_hostCode}${NC}] Uploading ${GREEN}${filename}${NC}"
|
||||
tor_identity="${RANDOM}"
|
||||
PostUrlHost='https://filesquid.net/script.php'
|
||||
arrFiles=("$filepath")
|
||||
trap "rm -f ${UploadTicket}; echo ""; tput cnorm; exit" 0 1 2 3 6 15
|
||||
response=$(tor_curl_upload --insecure -i \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F "time=month" \
|
||||
-F "file=@${filepath}" \
|
||||
"${PostUrlHost}")
|
||||
if [ "${DebugAllEnabled}" == "true" ] ; then
|
||||
debugHtml "${filepath##*/}" "${_hostCode}_upload" "post_url: ${PostUrlHost}"$'\n'"${response}"
|
||||
fi
|
||||
maxretries=4
|
||||
for ((i=1; i<=$maxretries; i++)); do
|
||||
tor_identity="${RANDOM}"
|
||||
PostUrlHost='https://filesquid.net/script.php'
|
||||
arrFiles=("$filepath")
|
||||
trap "rm -f ${UploadTicket}; echo ""; tput cnorm; exit" 0 1 2 3 6 15
|
||||
response=$(tor_curl_upload --insecure -i \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F "time=month" \
|
||||
-F "file=@${filepath}" \
|
||||
"${PostUrlHost}")
|
||||
if [ "${DebugAllEnabled}" == "true" ] ; then
|
||||
debugHtml "${filepath##*/}" "${_hostCode}_upload" "post_url: ${PostUrlHost}"$'\n'"${response}"
|
||||
fi
|
||||
if grep -Eqi 'No password nor allowed IP' <<< "$response"; then
|
||||
if ((i >= maxretries)) ; then
|
||||
echo -e "${RED}| Upload failed. No password nor allowed IP.${NC}"
|
||||
failedRetryUpload "$pline" "${filepath}" "${_hostCode}" "Failed to upload file" "No password nor allowed IP."
|
||||
exitUploadError=true
|
||||
return 1
|
||||
else
|
||||
echo -n "${YELLOW}No password nor allowed IP${NC} (retry)..."
|
||||
continue
|
||||
fi
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
if grep -Eqi ' 200 ' <<< "${response}" ; then
|
||||
hash=$(echo "$response" | tail -2 | head -1)
|
||||
hash=${hash//[$'\t\r\n']}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue