# 2025.02.18 - [uploadhive] Add handling of the new /cgi-bin/dl.cgi/ url tickets (WIP)
# (unfortunately, this is tied to the requesting ip, so downloads get "Wrong IP") # 2025.02.18 - [up_oshi] Add Manage url as comment on uploads # 2025.02.18 - [up_oshi / oshi] use /nossl/ url and http # 2025.02.17 - [gofile] Add a random sleep if 429 response detected (too many requests) # 2025.02.17 - [*ALL] Audit and update all single bracket operations # 2025.02.17 - [filehaus] Fix downloading from fh # 2025.02.15 - [uploadbay] Update urls regex for acceptable alternate # 2025.02.15 - [up_sendnow] Add send.now as upload host # 2025.02.15 - [sendnow] Fix handling of filenames with special characters in url
This commit is contained in:
parent
d48116dbe3
commit
d62376f7a8
103 changed files with 3541 additions and 3517 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#! Name: up_oshi.sh
|
||||
#! Author: kittykat
|
||||
#! Version: 2024.10.23
|
||||
#! Version: 2025.02.17
|
||||
#! Desc: Add support for uploading files to a new host
|
||||
#! Info: Files are accessible at https://oshi.at/<hash>
|
||||
#! MaxSize: 5GB
|
||||
|
|
@ -59,23 +59,23 @@ oshi_UploadFile() {
|
|||
fi
|
||||
finalAttempt="false"
|
||||
for ((z=0; z<=$MaxUploadRetries; z++)); do
|
||||
if [ $z -eq $MaxUploadRetries ] ; then
|
||||
if [[ $z -eq $MaxUploadRetries ]] ; then
|
||||
finalAttempt="true"
|
||||
fi
|
||||
trap "rm -f "${UploadTicket}"; echo ""; tput cnorm; exit" 0 1 2 3 6 15
|
||||
if oshi_PostFile "${filepath}" "${_hostCode}" "${filename}" "${filecnt}" $((z+1)) $finalAttempt $pline ; then
|
||||
return 0
|
||||
elif [ $z -lt $MaxUploadRetries ]; then
|
||||
if [ "${fileAlreadyDone}" == "true" ] ; then
|
||||
elif [[ $z -lt $MaxUploadRetries ]]; then
|
||||
if [[ "${fileAlreadyDone}" == "true" ]] ; then
|
||||
break
|
||||
fi
|
||||
if [[ "${warnAndRetryUnknownError}" == "true" ]] ; then
|
||||
if [ "${DebugAllEnabled}" == "true" ] ; then
|
||||
if [[ "${DebugAllEnabled}" == "true" ]] ; then
|
||||
debugHtml "${filepath##*/}" "error" "Retry due to an unknown issue: attempt #$((z+1)) of ${MaxUploadRetries}"
|
||||
fi
|
||||
fi
|
||||
if [[ "${exitUploadError}" == "true" || "${exitUploadNotAvailable}" == "true" ]] ; then
|
||||
if [ "${DebugAllEnabled}" == "true" ] ; then
|
||||
if [[ "${DebugAllEnabled}" == "true" ]] ; then
|
||||
debugHtml "${filepath##*/}" "error" "Exit due to unrecoverable issue"
|
||||
fi
|
||||
rm -f "${UploadTicket}"
|
||||
|
|
@ -101,9 +101,9 @@ oshi_PostFile() {
|
|||
UploadTicket="${WorkDir}/.flocks/upload_${_hostCode}_${filepath//[^a-zA-Z0-9]/}"
|
||||
echo -e "[${YELLOW}${_hostCode}${NC}] Uploading ${GREEN}${filename}${NC}"
|
||||
tor_identity="${RANDOM}"
|
||||
PostUrlHost='https://oshi.at/'
|
||||
if [ "$OshiUploadHostChoice" == "oshionion" ]; then
|
||||
PostUrlHost='http://5ety7tpkim5me6eszuwcje7bmy25pbtrjtue7zkqqgziljwqy3rrikqd.onion/'
|
||||
PostUrlHost='http://oshi.at/nossl/'
|
||||
if [[ "$OshiUploadHostChoice" == "oshionion" ]]; then
|
||||
PostUrlHost='http://5ety7tpkim5me6eszuwcje7bmy25pbtrjtue7zkqqgziljwqy3rrikqd.onion/nossl/'
|
||||
fi
|
||||
arrFiles=("$filepath")
|
||||
trap "rm -f ${UploadTicket}; echo ""; tput cnorm; exit" 0 1 2 3 6 15
|
||||
|
|
@ -114,22 +114,24 @@ oshi_PostFile() {
|
|||
-F "randomizefn=0" \
|
||||
-F "shorturl=0" \
|
||||
"${PostUrlHost}")
|
||||
if [ "${DebugAllEnabled}" == "true" ] ; then
|
||||
if [[ "${DebugAllEnabled}" == "true" ]] ; then
|
||||
debugHtml "${filepath##*/}" "${_hostCode}_upload" "post_url: ${PostUrlHost}"$'\n'"${response}"
|
||||
fi
|
||||
if grep -Eqi '^DL: ' <<< "${response}" ; then
|
||||
url=$(grep -oPi '(?<=^DL: ).*(?=$)' <<< "$response")
|
||||
manageUrl=$(grep -oPi '(?<=^MANAGE: ).*(?=$)' <<< "$response")
|
||||
hash=$(grep -oPi '(?<='"${PostUrlHost}"').*?(?=$)' <<< "$url")
|
||||
filesize=$(GetFileSize "$filepath" "false")
|
||||
downloadLink="$url"
|
||||
echo -e "${GREEN}| Upload Success${NC}"
|
||||
echo -e "| Size: ${BLUE}${filesize}${NC} bytes${NC}"
|
||||
echo -e "| Link: ${YELLOW}${downloadLink}${NC}"
|
||||
successUpload "$pline" "${filepath}" "${_hostCode}" "${filesize}" "${downloadLink}" "{$response}"
|
||||
echo -e "| Manage: ${YELLOW}${manageUrl}${NC}"
|
||||
successUpload "$pline" "${filepath}" "${_hostCode}" "${filesize}" "${downloadLink}" "{$response}" "[Manage: $manageUrl]"
|
||||
return 0
|
||||
else
|
||||
err=$(grep -oPi '(?<="HTTP/2 ").*?(?=$)' <<< "$response")
|
||||
if [ "${finalAttempt}" == "true" ] ; then
|
||||
if [[ "${finalAttempt}" == "true" ]] ; then
|
||||
printf "\\n"
|
||||
echo -e "${RED}| Upload failed. Code: ${err}${NC}"
|
||||
failedRetryUpload "$pline" "${filepath}" "${_hostCode}" "Failed to upload file" "Code: $err"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue