# 2025.02.14 - [mad] Add helpful verbiage for user on MAD Randomized Extension upload urls

# 2025.02.14 - [up_ranoz] Add help "[rand ext, rename to <filename> or use MAD v2025.02.13+]" to url
# 2025.02.14 - [up_uploadhive] Add help "[rand ext, rename to <filename> or use MAD v2025.02.13+]" to url
# 2025.02.13 - [mad] Add "RanozRandomizeExt" MAD randomized extension configurable variable
# 2025.02.13 - [up_ranoz] Add MAD randomized extension upload handling
# 2025.02.13 - [ranoz] Add MAD randomized extension download handling
# 2025.02.13 - [sendnow] Extend request timeout for head / get (server response time lag)
This commit is contained in:
kittykat 2025-02-17 22:54:05 +00:00
parent 0face871aa
commit d48116dbe3
Signed by: kittykat
GPG key ID: E3F1556620F70C3C
14 changed files with 880 additions and 552 deletions

79
hosts/up_ranoz.sh Normal file → Executable file
View file

@ -1,6 +1,6 @@
#! Name: up_ranoz.sh
#! Author: kittykat
#! Version: 2024.11.27
#! Version: 2025.02.14
#! Desc: Add support for uploading files to bedrive.ru
#! Info: Files are accessible at https://ranoz.gg/file/<file_code>
#! MaxSize: 20GB
@ -37,7 +37,7 @@ rz_UploadFile() {
local filepath=${2}
local filecnt=${3}
local pline=${4}
local filename="${filepath##*/}"
local filename="${filepath##*/}"
warnAndRetryUnknownError=false
exitUploadError=false
exitUploadNotAvailable=false
@ -97,16 +97,42 @@ rz_PostFile() {
echo -e "[${YELLOW}${_hostCode}${NC}] Uploading ${GREEN}${filename}${NC}"
tor_identity="${RANDOM}"
PostUrlHost='https://ranoz.gg/api/v1/files/upload_url'
if [[ "$RanozRandomizeExt" == "true" ]] && [[ ! $filename == *.rar ]]; then
randomext=$(GetSemiRandomExt)
echo -e "${BLUE}MAD Randomized Extension: $randomext${NC}"
origext=${filepath##*.}
if [[ "$origext" == "7z" ]]; then
tmpfilepath="${filepath%.*}--7_.${randomext}"
elif [[ "$origext" == "zip" ]]; then
tmpfilepath="${filepath%.*}--z_.${randomext}"
elif grep -Eqi '\.part.*\.rar' <<< "${filepath##*/}" ; then
partnum="${filepath##*.part}"
partnum="${partnum%.rar*}"
echo -e "$partnum"
tmpfilepath="${filepath%.part*}_-p${partnum}--r_.${randomext}"
elif [[ "$origext" == "rar" ]]; then
tmpfilepath="${filepath%.*}--r_.${randomext}"
elif [[ "$origext" == "tar" ]]; then
tmpfilepath="${filepath%.*}--t_.${randomext}"
elif [[ "${filepath##*/}" == *".7z."* ]]; then
tmpfilepath="${filepath%.*}_-7--${origext}_.${randomext}"
else
tmpfilepath="${filepath%.*}--${origext}_.${randomext}"
fi
tmpfilename="${tmpfilepath##*/}"
else
tmpfilename="${tmpfilepath##*/}"
fi
local fsize=$(stat -c%s "$filepath")
trap "rm -f ${UploadTicket}; echo ""; tput cnorm; exit" 0 1 2 3 6 15
response=$(tor_curl_upload --insecure -L -i -s \
"$PostUrlHost" \
-H "Content-Type: application/json" \
-d "{ \
\"filename\": \"$filename\", \
\"filename\": \"$tmpfilename\", \
\"size\": $fsize}")
if [ "${DebugAllEnabled}" == "true" ] ; then
debugHtml "${filepath##*/}" "${_hostCode}_ticket" "post_url: ${PostUrlHost}"$'\n'"data: ${filename}, ${fsize}"$'\n'"${response}"
debugHtml "${filepath##*/}" "${_hostCode}_ticket" "post_url: ${PostUrlHost}"$'\n'"data: ${filepath}, ${fsize}"$'\n'"${response}"
fi
if grep -Eqi '"upload_url":"https://' <<< "$response" ; then
PostUrlHost=$(grep -oPi '(?<="upload_url":").*?(?=".*$)' <<< "$response")
@ -138,7 +164,11 @@ rz_PostFile() {
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}"
if [[ "$RanozRandomizeExt" == "true" ]]; then
successUpload "$pline" "${filepath}" "${_hostCode}" "${filesize}" "${downloadLink}" "{$response}" "[rand ext, rename to $filename or use MAD v2025.02.13+]"
else
successUpload "$pline" "${filepath}" "${_hostCode}" "${filesize}" "${downloadLink}" "{$response}"
fi
return 0
else
err=$(grep -oPi '(?<=HTTP/.*).*?(?=$)' <<< "$response")
@ -156,3 +186,42 @@ rz_PostFile() {
#!
#! --------------- Host Extra Functions ------------------- #
#!
GetSemiRandomExt() {
local ar_rEXT[0]='pdf'
local ar_rEXT[1]='doc'
local ar_rEXT[2]='xls'
local ar_rEXT[3]='mdb'
local ar_rEXT[4]='xml'
local ar_rEXT[5]='xsd'
local ar_rEXT[6]='svg'
local ar_rEXT[7]='img'
local ar_rEXT[8]='iso'
local ar_rEXT[9]='svg'
local ar_rEXT[10]='ico'
local ar_rEXT[11]='bmp'
local ar_rEXT[12]='eps'
local ar_rEXT[13]='3gp'
local ar_rEXT[14]='png'
local ar_rEXT[15]='wav'
local ar_rEXT[16]='mp3'
local ar_rEXT[17]='tif'
local ar_rEXT[18]='swf'
local ar_rEXT[19]='rtf'
local ar_rEXT[20]='ppt'
local ar_rEXT[21]='png'
local ar_rEXT[22]='jpg'
local ar_rEXT[23]='mpg'
local ar_rEXT[24]='mp4'
local ar_rEXT[25]='aac'
local ar_rEXT[26]='mid'
local ar_rEXT[27]='ics'
local ar_rEXT[28]='gif'
local ar_rEXT[29]='csv'
local ar_rEXT[30]='ogg'
local ar_rEXT[31]='txt'
local ar_rEXT[32]='css'
local ar_rEXT[33]='htm'
local arrSize=${#ar_rEXT[@]}
local index=$(($RANDOM % $arrSize))
printf "%s" "${ar_rEXT[$index]}"
}