# 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:
parent
0face871aa
commit
d48116dbe3
14 changed files with 880 additions and 552 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#! Name: filehaus.sh
|
||||
#! Author: kittykat
|
||||
#! Version: 2024.09.13
|
||||
#! Version: 2025.02.17
|
||||
#! Desc: Add support for downloading and processing of urls for a new host
|
||||
#! Usage: Copy this file into the ./${ScriptDir}/hosts/ folder
|
||||
#!
|
||||
|
|
@ -93,6 +93,7 @@ fh_FetchFileInfo() {
|
|||
echo -e "Trying .top domain..."
|
||||
download_url=${download_url/\.su/\.top}
|
||||
fi
|
||||
filename=${download_url##*/} # Requires unique filename.ext but good for multipart files
|
||||
download_url=$(urlencode_literal_grouped_case_urlendingonly "$download_url")
|
||||
tor_identity="${RANDOM}"
|
||||
CLEANSTRING=${remote_url//[^a-zA-Z0-9]/}
|
||||
|
|
@ -138,9 +139,7 @@ fh_FetchFileInfo() {
|
|||
done
|
||||
touch ${WorkDir}/.flocks/${remote_url//[^a-zA-Z0-9]/}
|
||||
if [ ! "$filename_override" == "" ] ; then
|
||||
filename="$filename_override"
|
||||
else
|
||||
filename=${download_url##*/} # Requires unique filename.ext but good for multipart files
|
||||
filename="$filename_override"
|
||||
fi
|
||||
filename=$(sanitize_file_or_folder_name "${filename}")
|
||||
file_size_bytes=$(grep -oPi '(?<=content-length: ).*' <<< "$file_header")
|
||||
|
|
@ -181,7 +180,6 @@ fh_GetFile() {
|
|||
if (( splitnum == 0)); then
|
||||
splitnum=1
|
||||
fi
|
||||
download_url=$(urlencode_literal_grouped_case_urlendingonly "$download_url")
|
||||
pd_presize=0
|
||||
if [ -f "$file_path" ] ; then
|
||||
pd_presize=$(stat --format="%s" "$file_path" | tr -d '[:space:]')
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#! Name: ranoz.sh
|
||||
#! Author: kittykat
|
||||
#! Version: 2025.02.11
|
||||
#! Version: 2025.02.13
|
||||
#! Desc: Add support for downloading and processing of urls for a new host
|
||||
#! Usage: Copy this file into the ./${ScriptDir}/hosts/ folder
|
||||
#!
|
||||
|
|
@ -392,6 +392,63 @@ rz_GetFile() {
|
|||
done
|
||||
rm -f "$flockDownload";
|
||||
rm -f "${rz_cookie_jar}";
|
||||
if grep -Eqi '^.*--7_\....$' <<< "$filename" ; then
|
||||
echo -e ""
|
||||
echo -e "${BLUE}| Found mad upload random extension file (renaming 7z)...${NC}"
|
||||
origext="7z"
|
||||
mv "$file_path" "${file_path%\--7_*}.$origext"
|
||||
filename="${filename%\--7_*}.$origext"
|
||||
file_path="${file_path%\--7_*}.$origext"
|
||||
elif grep -Eqi '^.*--z_\....$' <<< "$filename" ; then
|
||||
echo -e ""
|
||||
echo -e "${BLUE}| Found mad upload random extension file (renaming zip)...${NC}"
|
||||
origext="zip"
|
||||
mv "$file_path" "${file_path%\--z_*}.$origext"
|
||||
filename="${filename%\--z_*}.$origext"
|
||||
file_path="${file_path%\--z_*}.$origext"
|
||||
elif grep -Eqi '^.*_-p.*--r_\....$' <<< "$filename" ; then
|
||||
echo -e ""
|
||||
echo -e "${BLUE}| Found mad upload random extension file (renaming mp rar)...${NC}"
|
||||
origext="rar"
|
||||
partnum="${filename##*_-p}"
|
||||
partnum="${partnum%--r_*}"
|
||||
newfilepath="${file_path%_-p*}.part${partnum}.$origext"
|
||||
mv "$file_path" "$newfilepath"
|
||||
filename="${newfilepath##*/}"
|
||||
file_path="${newfilepath}"
|
||||
elif grep -Eqi '^.*--r_\....$' <<< "$filename" ; then
|
||||
echo -e ""
|
||||
echo -e "${BLUE}| Found mad upload random extension file (renaming rar)...${NC}"
|
||||
origext="rar"
|
||||
mv "$file_path" "${file_path%--r_*}.$origext"
|
||||
filename="${filename%--r_*}.$origext"
|
||||
file_path="${file_path%--r_*}.$origext"
|
||||
elif grep -Eqi '^.*--t_\....$' <<< "$filename" ; then
|
||||
echo -e ""
|
||||
echo -e "${BLUE}| Found mad upload random extension file (renaming tar)...${NC}"
|
||||
origext="tar"
|
||||
mv "$file_path" "${file_path%--t_*}.$origext"
|
||||
filename="${filename%--t_*}.$origext"
|
||||
file_path="${file_path%--t_*}.$origext"
|
||||
elif grep -Eqi '^.*_-7--..._\....$' <<< "$filename" ; then
|
||||
echo -e ""
|
||||
echo -e "${BLUE}| Found mad upload random extension file (renaming)...${NC}"
|
||||
origext=${filename##*--}
|
||||
origext=${origext%_*}
|
||||
newfilepath="${file_path%--*}.$origext"
|
||||
newfilepath="${newfilepath//_-7/.7z}"
|
||||
mv "$file_path" "$newfilepath"
|
||||
filename="${newfilepath##*/}"
|
||||
file_path="${newfilepath}"
|
||||
elif grep -Eqi '^.*--..._\....$' <<< "$filename" ; then
|
||||
echo -e ""
|
||||
echo -e "${BLUE}| Found mad upload random extension file (renaming)...${NC}"
|
||||
origext=${filename##*--}
|
||||
origext=${origext%_*}
|
||||
mv "$file_path" "${file_path%--*}.$origext"
|
||||
filename="${filename%--*}.$origext"
|
||||
file_path="${file_path%--*}.$origext"
|
||||
fi
|
||||
ProcessCompletedDownload "$remote_url" "$MoveToFolder" "$filecnt" "$filename" "$file_size_bytes" "$completed_location" "$file_path"
|
||||
return 0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#! Name: sendnow.sh
|
||||
#! Author: kittykat
|
||||
#! Version: 2025.02.12
|
||||
#! Version: 2025.02.15
|
||||
#! Desc: Add support for downloading and processing of urls for a new host
|
||||
#! Usage: Copy this file into the ./${ScriptDir}/hosts/ folder
|
||||
#!
|
||||
|
|
@ -79,7 +79,7 @@ snow_FetchFileInfo() {
|
|||
finalAttempt=$1
|
||||
maxfetchretries=5
|
||||
snow_cookie_jar=""
|
||||
echo -e "${GREEN}# Fetching download link…${NC}"
|
||||
echo -e "${GREEN}# Fetching post info…${NC}"
|
||||
for ((i=1; i<=$maxfetchretries; i++)); do
|
||||
mkdir -p "${WorkDir}/.temp"
|
||||
snow_cookie_jar=$(mktemp "${WorkDir}/.temp/snow_cookies""${instance_no}"".XXXXXX")
|
||||
|
|
@ -105,7 +105,7 @@ snow_FetchFileInfo() {
|
|||
continue
|
||||
fi
|
||||
fi
|
||||
if grep -Eqi "Sorry, you are banned" <<< "$response"; then
|
||||
if grep -Eqi "Your IP has been banned|you are banned" <<< "$response"; then
|
||||
rm -f "${snow_cookie_jar}";
|
||||
if [ $i == $maxfetchretries ] ; then
|
||||
printf "\\n"
|
||||
|
|
@ -135,6 +135,7 @@ snow_FetchFileInfo() {
|
|||
post_rand=$(grep -oPi '(?<=input type="hidden" name="rand" value=").*(?=">)' <<< "$response")
|
||||
post_referer=$(grep -oPi '(?<=input type="hidden" name="referer" value=").*(?=">)' <<< "$response")
|
||||
fi
|
||||
file_size_readable=$(grep -oPi '(?<=</i> Download \[).*?(?=\]</button>.*$)' <<< "$response")
|
||||
if [[ -z "$post_op" ]] || [[ -z "$post_id" ]] ; then
|
||||
rm -f "${snow_cookie_jar}";
|
||||
if [ $i == $maxfetchretries ] ; then
|
||||
|
|
@ -152,6 +153,7 @@ snow_FetchFileInfo() {
|
|||
break
|
||||
fi
|
||||
done
|
||||
echo -e "${GREEN}# Fetching download url…${NC}"
|
||||
CLEANSTRING=${remote_url//[^a-zA-Z0-9]/}
|
||||
trap "rm -f ${WorkDir}/.flocks/${CLEANSTRING}; echo ""; rm -f $snow_cookie_jar; tput cnorm; exit" 0 1 2 3 6 15
|
||||
form_data="op=$post_op&id=$post_id&rand=$post_rand&referer=&method_free=&method_premium="
|
||||
|
|
@ -182,6 +184,7 @@ snow_FetchFileInfo() {
|
|||
download_url=${download_url//[$'\t\r\n']}
|
||||
filename="${download_url##*/}"
|
||||
filename=${filename//[$'\t\r\n']}
|
||||
download_url=$(urlencode_literal_grouped_case_urlendingonly ${download_url})
|
||||
else
|
||||
echo -e "${RED}| Failed to extract download link [3]${NC}"
|
||||
warnAndRetryUnknownError=true
|
||||
|
|
@ -193,11 +196,12 @@ snow_FetchFileInfo() {
|
|||
fi
|
||||
echo -e "${GREEN}# Fetching file info…${NC}"
|
||||
fshost=$(grep -oPi -m 1 '(?<=https://).*?(?=/d/)' <<< "$download_url")
|
||||
fshost=${fshost//[$'\t\r\n']}
|
||||
for ((j=1; j<=$maxfetchretries; j++)); do
|
||||
printf " ."
|
||||
CLEANSTRING=${remote_url//[^a-zA-Z0-9]/}
|
||||
trap "rm -f ${WorkDir}/.flocks/${CLEANSTRING}; rm -f ${snow_cookie_jar}; echo ""; tput cnorm; exit" 0 1 2 3 6 15
|
||||
file_header=$(tor_curl_request --insecure --head -Lis \
|
||||
file_header=$(tor_curl_request_extended --insecure --head -Lis \
|
||||
-H "Host: $fshost" \
|
||||
-H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \
|
||||
-H "Accept-Language: en-US,en;q=0.5" \
|
||||
|
|
@ -284,7 +288,7 @@ snow_FetchFileInfo() {
|
|||
if [ "${finalAttempt}" == "true" ] ; then
|
||||
failedRetryDownload "${remote_url}" "Filesize not found!" ""
|
||||
fi
|
||||
echo -e "${YELLOW}| Filesize not found… retry${NC}"
|
||||
echo -e "${YELLOW}| Filesize not found…${NC}"
|
||||
return 1
|
||||
else
|
||||
file_size_readable="$(numfmt --to=iec --from=auto --format "%.2f" <<< "$file_size_bytes")"
|
||||
|
|
@ -320,7 +324,7 @@ snow_GetFile() {
|
|||
trap "rm -f ${WorkDir}/.flocks/${CLEANSTRING}; rm -f ${snow_cookie_jar}; rm -f $flockDownload; echo ""; tput cnorm; exit" 0 1 2 3 6 15
|
||||
if [ "${UseTorCurlImpersonate}" == "true" ]; then
|
||||
if [ "${RateMonitorEnabled}" == "true" ]; then
|
||||
tor_curl_request --insecure -L --no-alpn \
|
||||
tor_curl_request_extended --insecure -L --no-alpn \
|
||||
--speed-limit $DownloadSpeedMin --speed-time $DownloadTimeoutInterval \
|
||||
-H "Host: $fshost" \
|
||||
-H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \
|
||||
|
|
|
|||
79
hosts/up_ranoz.sh
Normal file → Executable file
79
hosts/up_ranoz.sh
Normal file → Executable 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]}"
|
||||
}
|
||||
|
|
|
|||
178
hosts/up_sendnow.sh
Normal file
178
hosts/up_sendnow.sh
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
#! Name: up_sendnow.sh
|
||||
#! Author: kittykat
|
||||
#! Version: 2025.02.15
|
||||
#! Desc: Add support for uploading files to a new host
|
||||
#! Info: Files are accessible at https://send.now/<hash>
|
||||
#! MaxSize: 100GB
|
||||
#! Expire: 30 days
|
||||
#! Usage: Copy this file into the ./${ScriptDir}/hosts/ folder
|
||||
#!
|
||||
#!
|
||||
#! ------------ REQUIRED SECTION ---------------
|
||||
#! @[UPDATE] ListUploadHosts: This string is loaded into mad.sh and allows dynamic handling of new url data
|
||||
#! Format: '/HostCode/HostNick/HostFuncPrefix@'
|
||||
#! HostCode: <aUniqueCodeForHost> (ie. 'fh' for filehaus -- cannot be used by other hosts)
|
||||
#! HostNick: What is displayed throughout MAD output
|
||||
#! HostFuncPrefix: <aUniqueStringThatMustPrefixHostFunctions> ie. 'fh' -- fh_UploadFile()
|
||||
#! * Note: Must begin with a letter a-z (functions beginning with numbers are no bueno)
|
||||
HostCode='snow'
|
||||
HostNick='send.now'
|
||||
HostFuncPrefix='snow'
|
||||
#!
|
||||
#! !! DO NOT UPDATE OR REMOVE !!
|
||||
#! This merges the Required HostAndDomainRegexes into mad.sh
|
||||
ListUploadHosts=${ListUploadHosts}'/'${HostCode}'/'${HostNick}'/'${HostFuncPrefix}'@'
|
||||
#!
|
||||
#!
|
||||
#! Configurables
|
||||
#! -------------
|
||||
#!
|
||||
#! ------------ (1) Host Main Upload Function --------------- #
|
||||
#!
|
||||
#! @REQUIRED: Host Main Upload function
|
||||
#! Must be named specifically as such:
|
||||
#! <HostFuncPrefix>_UploadFile()
|
||||
snow_UploadFile() {
|
||||
local _hostCode=${1}
|
||||
local filepath=${2}
|
||||
local filecnt=${3}
|
||||
local pline=${4}
|
||||
local filename="${filepath##*/}"
|
||||
warnAndRetryUnknownError=false
|
||||
exitUploadError=false
|
||||
exitUploadNotAvailable=false
|
||||
fileAlreadyDone=false
|
||||
tor_identity="${RANDOM}"
|
||||
UploadTicket="${WorkDir}/.flocks/upload_${_hostCode}_${filepath//[^a-zA-Z0-9]/}"
|
||||
MaxUploadSizeInBytes=107374182400
|
||||
fsize=$(GetFileSize "$filepath" "false")
|
||||
if ((fsize > MaxUploadSizeInBytes)); then
|
||||
rm -f "${UploadTicket}"
|
||||
echo -e "${YELLOW}| SKIP${NC}: The size of $filename is to large for $_hostCode. ($fsize > $MaxUploadSizeInBytes)"
|
||||
failedUpload "$pline" "${filepath}" "${_hostCode}" "Skipping upload. The size of $filename is to large for $_hostCode. ($fsize > $MaxUploadSizeInBytes)"
|
||||
return 1
|
||||
fi
|
||||
finalAttempt="false"
|
||||
for ((z=0; z<=$MaxUploadRetries; z++)); do
|
||||
if [ $z -eq $MaxUploadRetries ] ; then
|
||||
finalAttempt="true"
|
||||
fi
|
||||
trap "rm -f "${UploadTicket}"; echo ""; tput cnorm; exit" 0 1 2 3 6 15
|
||||
if snow_PostFile "${filepath}" "${_hostCode}" "${filename}" "${filecnt}" $((z+1)) $finalAttempt $pline ; then
|
||||
return 0
|
||||
elif [ $z -lt $MaxUploadRetries ]; then
|
||||
if [ "${fileAlreadyDone}" == "true" ] ; then
|
||||
break
|
||||
fi
|
||||
if [[ "${warnAndRetryUnknownError}" == "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
|
||||
debugHtml "${filepath##*/}" "error" "Exit due to unrecoverable issue"
|
||||
fi
|
||||
rm -f "${UploadTicket}"
|
||||
break
|
||||
fi
|
||||
echo -e "\n${YELLOW}A recoverable error occurred, retry attempt $((z+1))/${MaxUploadRetries}${NC}"
|
||||
sleep 3
|
||||
fi
|
||||
done
|
||||
rm -f "${UploadTicket}"
|
||||
}
|
||||
#!
|
||||
#! ----------- (2) Post File / Upload File Function --------------- #
|
||||
#!
|
||||
snow_PostFile() {
|
||||
local filepath=$1
|
||||
local _hostCode=$2
|
||||
local filename=$3
|
||||
local fileCnt=$4
|
||||
local retryCnt=$5
|
||||
local finalAttempt=$6
|
||||
local pline=${7}
|
||||
UploadTicket="${WorkDir}/.flocks/upload_${_hostCode}_${filepath//[^a-zA-Z0-9]/}"
|
||||
echo -e "[${YELLOW}${_hostCode}${NC}] Finding good Tor node{NC}"
|
||||
for ((i=0; i<=15; i++)); do
|
||||
tor_identity="${RANDOM}"
|
||||
trap "rm -f ${UploadTicket}; echo ""; tput cnorm; exit" 0 1 2 3 6 15
|
||||
response=$(tor_curl_request --insecure -L -s 'https://send.now/upload')
|
||||
if [ "${DebugAllEnabled}" == "true" ] ; then
|
||||
debugHtml "${filepath##*/}" "${_hostCode}_fetch" "${response}"
|
||||
fi
|
||||
if grep -Eqi "Your IP has been banned|you are banned" <<< "$response"; then
|
||||
if [ "${finalAttempt}" == "true" ] ; then
|
||||
printf "\\n"
|
||||
echo -e "${RED}| Failed to upload file: Ip blocked or banned${NC}"
|
||||
failedRetryUpload "$pline" "${filepath}" "${_hostCode}" "Failed to upload file" "Ip blocked or banned"
|
||||
exitUploadError=true
|
||||
return 1
|
||||
else
|
||||
continue
|
||||
fi
|
||||
elif grep -Eqi 'action="https://.*send\.now/cgi-bin/upload\.cgi\?upload_type\=' <<< "$response"; then
|
||||
echo -e "${GREEN}| Node found${NC}"
|
||||
break
|
||||
else
|
||||
if [ "${finalAttempt}" == "true" ] ; then
|
||||
printf "\\n"
|
||||
echo -e "${RED}| Failed to upload file: unable to find a good Tor node${NC}"
|
||||
failedRetryUpload "$pline" "${filepath}" "${_hostCode}" "Failed to upload file" "Unable to find a good Tor node"
|
||||
exitUploadError=true
|
||||
return 1
|
||||
else
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo -e "[${YELLOW}${_hostCode}${NC}] Uploading ${GREEN}${filename}${NC}"
|
||||
local ar_HUP[0]="https://u7324.send.now/cgi-bin/upload.cgi?upload_type=file&utype=anon"
|
||||
local arrSize=${#ar_HUP[@]}
|
||||
local index=$(($RANDOM % $arrSize))
|
||||
local RandomHostUploadUrl=${ar_HUP[$index]}
|
||||
PostUrlHost="$RandomHostUploadUrl"
|
||||
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 "sess_id=" \
|
||||
-F "utype=anon" \
|
||||
-F "file_descr=" \
|
||||
-F "file_public=1" \
|
||||
-F "link_rcpt=" \
|
||||
-F "link_pass=" \
|
||||
-F "to_folder=" \
|
||||
-F "upload=Start upload" \
|
||||
-F "keepalive=1" \
|
||||
-F "file_0=@$filepath" \
|
||||
"${PostUrlHost}")
|
||||
if [ "${DebugAllEnabled}" == "true" ] ; then
|
||||
debugHtml "${filepath##*/}" "${_hostCode}_upload" "post_url: ${PostUrlHost}"$'\n'"${response}"
|
||||
fi
|
||||
if grep -Eqi '"file_status":"OK"' <<< "${response}" ; then
|
||||
hash=$(grep -oPi '(?<="file_code":").*?(?=".*$)' <<< "$response")
|
||||
filesize=$(GetFileSize "$filepath" "false")
|
||||
downloadLink="https://isupload.com/${hash}"
|
||||
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}"
|
||||
return 0
|
||||
else
|
||||
err=$(grep -oPi '(?<="file_status":").*?(?=")' <<< "$response")
|
||||
if [ "${finalAttempt}" == "true" ] ; then
|
||||
printf "\\n"
|
||||
echo -e "${RED}| Upload failed. Status: ${err}${NC}"
|
||||
failedRetryUpload "$pline" "${filepath}" "${_hostCode}" "Failed to upload file" "Status: $err"
|
||||
exitUploadError=true
|
||||
return 1
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
#!
|
||||
#! --------------- Host Extra Functions ------------------- #
|
||||
#!
|
||||
18
hosts/up_uploadhive.sh
Normal file → Executable file
18
hosts/up_uploadhive.sh
Normal file → Executable file
|
|
@ -1,6 +1,6 @@
|
|||
#! Name: up_uploadhive.sh
|
||||
#! Author: kittykat
|
||||
#! Version: 2024.12.25
|
||||
#! Version: 2025.02.14
|
||||
#! Desc: Add support for uploading files to uploadhive.com
|
||||
#! Info: Files are accessible at https://uploadhive.com/<file_code>
|
||||
#! MaxSize: 5GB
|
||||
|
|
@ -100,6 +100,7 @@ uhive_PostFile() {
|
|||
if [[ "$UploadHiveRandomizeExt" == "true" ]]; then
|
||||
randomext=$(mktemp -u XXX)
|
||||
randomext=${randomext,,}
|
||||
echo -e "${BLUE}MAD Randomized Extension: $randomext${NC}"
|
||||
origext=${filepath##*.}
|
||||
if [[ "$origext" == "7z" ]]; then
|
||||
tmpfilepath="${filepath%.*}--7_.${randomext}"
|
||||
|
|
@ -119,12 +120,13 @@ uhive_PostFile() {
|
|||
else
|
||||
tmpfilepath="${filepath%.*}--${origext}_.${randomext}"
|
||||
fi
|
||||
mv $filepath $tmpfilepath
|
||||
echo -e "Creating temp random ext file..."
|
||||
cp $filepath $tmpfilepath
|
||||
else
|
||||
tmpfilepath=$filepath
|
||||
fi
|
||||
arrFiles=("$filepath")
|
||||
trap "rm -f ${UploadTicket}; echo ""; tput cnorm; exit" 0 1 2 3 6 15
|
||||
arrFiles=("$tmpfilepath")
|
||||
trap "rm -f ${UploadTicket}; echo ""; rm -f $tmpfilepath; tput cnorm; exit" 0 1 2 3 6 15
|
||||
response=$(tor_curl_upload --insecure -i \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F "sess_id=" \
|
||||
|
|
@ -141,7 +143,7 @@ uhive_PostFile() {
|
|||
debugHtml "${filepath##*/}" "${_hostCode}_upload" "post_url: ${PostUrlHost}"$'\n'"${response}"
|
||||
fi
|
||||
if [[ "$UploadHiveRandomizeExt" == "true" ]]; then
|
||||
mv $tmpfilepath $filepath
|
||||
rm -f $tmpfilepath;
|
||||
fi
|
||||
if grep -Eqi '"file_status":"OK"' <<< "${response}" ; then
|
||||
hash=$(grep -oPi '(?<=file_code":").*?(?=".*$)' <<< "$response")
|
||||
|
|
@ -150,7 +152,11 @@ uhive_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 [[ "$UploadHiveRandomizeExt" == "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 '(?<="file_status":").*?(?=".*$)' <<< "$response")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#! Name: uploadbay.sh
|
||||
#! Author: kittykat
|
||||
#! Version: 2024.12.23
|
||||
#! Version: 2025.02.15
|
||||
#! Desc: Add support for downloading and processing of urls for a new host
|
||||
#! Usage: Copy this file into the ./${ScriptDir}/hosts/ folder
|
||||
#!
|
||||
|
|
@ -17,7 +17,7 @@ HostCode='ubay'
|
|||
HostNick='uploadbay'
|
||||
HostFuncPrefix='direct'
|
||||
HostUrls='uploadbay.net'
|
||||
HostDomainRegex='^(http|https)://(.*\.)?uploadbay\.net/uploads/'
|
||||
HostDomainRegex='^(http|https)://(.*\.)?uploadbay\.net(/|/uploads/)'
|
||||
#!
|
||||
#! !! DO NOT UPDATE OR REMOVE !!
|
||||
#! This merges the Required HostAndDomainRegexes into mad.sh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue