# 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:
kittykat 2025-02-19 13:41:07 +00:00
parent d48116dbe3
commit d62376f7a8
Signed by: kittykat
GPG key ID: E3F1556620F70C3C
103 changed files with 3541 additions and 3517 deletions

View file

@ -44,24 +44,24 @@ dosya_DownloadFile() {
tor_identity="${RANDOM}"
finalAttempt="false"
for ((z=0; z<=$MaxUrlRetries; z++)); do
if [ $z -eq $MaxUrlRetries ] ; then
if [[ $z -eq $MaxUrlRetries ]] ; then
finalAttempt="true"
fi
CLEANSTRING=${remote_url//[^a-zA-Z0-9]/}
trap "rm -f ${WorkDir}/.flocks/${CLEANSTRING}; echo ""; tput cnorm; exit" 0 1 2 3 6 15
if dosya_FetchFileInfo $finalAttempt && dosya_GetFile "${filecnt}" $((z+1)) $finalAttempt ; then
return 0
elif [ $z -lt $MaxUrlRetries ]; then
if [ "${fileAlreadyDone}" == "true" ] ; then
elif [[ $z -lt $MaxUrlRetries ]]; then
if [[ "${fileAlreadyDone}" == "true" ]] ; then
break
fi
if [[ "${warnAndRetryUnknownError}" == "true" ]] ; then
if [ "${DebugAllEnabled}" == "true" ] ; then
if [[ "${DebugAllEnabled}" == "true" ]] ; then
debugHtml "${remote_url##*/}" "error" "Retry due to an unknown issue: attempt #$((z+1)) of ${MaxUrlRetries}"
fi
fi
if [[ "${exitDownloadError}" == "true" || "${exitDownloadNotAvailable}" == "true" ]] ; then
if [ "${DebugAllEnabled}" == "true" ] ; then
if [[ "${DebugAllEnabled}" == "true" ]] ; then
debugHtml "${remote_url##*/}" "error" "Exit due to unrecoverable issue"
fi
rm -f "${WorkDir}/.flocks/${remote_url//[^a-zA-Z0-9]/}"
@ -105,7 +105,7 @@ dosya_FetchFileInfo() {
tor_identity="${RANDOM}"
GetRandomUA
trap "rm -f ${WorkDir}/.flocks/${CLEANSTRING}; rm -f ${dosya_cookie_jar}; echo ""; tput cnorm; exit" 0 1 2 3 6 15
if [ "${UseTorCurlImpersonate}" == "true" ]; then
if [[ "${UseTorCurlImpersonate}" == "true" ]]; then
PAGE=$(tor_curl_request --insecure --max-time "$ConnectTimeout" -L -s \
-c "${dosya_cookie_jar}" \
"${remote_url}")
@ -119,7 +119,7 @@ dosya_FetchFileInfo() {
-c "${dosya_cookie_jar}" \
"${remote_url}")
fi
if [ "${DebugAllEnabled}" == "true" ] ; then
if [[ "${DebugAllEnabled}" == "true" ]] ; then
debugHtml "${remote_url##*/}" "dos_fetch_$i" "remote_url: ${remote_url}"$'\n'"User-Agent: $RandomUA"$'\n'"${PAGE}"
fi
if grep -Eqi '<i class="fa fa-exclamation-triangle margin-right-20">|Hata indir|Dosya silindi|Oops - Sayfa Bulunamadı!' <<< "${PAGE}" ; then
@ -169,7 +169,7 @@ dosya_FetchFileInfo() {
dos_url=${dos_url/dosyaupload.com/www.dosyaupload.com}
fi
trap "rm -f ${WorkDir}/.flocks/${CLEANSTRING}; rm -f ${dosya_cookie_jar}; echo ""; tput cnorm; exit" 0 1 2 3 6 15
if [ "${UseTorCurlImpersonate}" == "true" ]; then
if [[ "${UseTorCurlImpersonate}" == "true" ]]; then
file_header=$(tor_curl_request_extended --insecure --head -L -s \
-H "Cookie: filehosting=$cookie_filehosting" \
-H "Host: www.dosyaupload.com" \
@ -188,10 +188,10 @@ dosya_FetchFileInfo() {
-H 'Sec-Fetch-Dest: document' -H 'Sec-Fetch-Mode: navigate' -H 'Sec-Fetch-Site: none' -H 'Sec-Fetch-User: ?1' \
-b "${dosya_cookie_jar}" -c "${dosya_cookie_jar}" "$dos_url")
fi
if [ "${DebugAllEnabled}" == "true" ] ; then
if [[ "${DebugAllEnabled}" == "true" ]] ; then
debugHtml "${remote_url##*/}" "dos_head_""$i"_"$j" "dos_url: ${dos_url}"$'\n'"User-Agent: $RandomUA"$'\n\n'"${file_header}"
fi
if [ ! -z "$file_header" ] ; then
if [[ ! -z "$file_header" ]] ; then
bIsLocation=false
bIsContentLength=false
if grep -Eqi 'download_token=' <<< $dos_url ; then
@ -204,7 +204,7 @@ dosya_FetchFileInfo() {
printf "\\n"
fi
echo -e "${RED}| The cdn url returned no response or disconnected client. Try again later.${NC}"
if [ "${finalAttempt}" == "true" ] ; then
if [[ "${finalAttempt}" == "true" ]] ; then
failedRetryDownload "${remote_url}" "The cdn url returned no response or disconnected client. Try again later." ""
fi
return 1
@ -258,7 +258,7 @@ dosya_FetchFileInfo() {
printf "\\n"
fi
echo -e "${RED}| Failed to find pt url${NC}"
if [ "${finalAttempt}" == "true" ] ; then
if [[ "${finalAttempt}" == "true" ]] ; then
failedRetryDownload "${remote_url}" "" ""
fi
return 1
@ -278,7 +278,7 @@ dosya_FetchFileInfo() {
printf "\\n"
fi
echo -e "${RED}| Failed to extract file size${NC}"
if [ "${finalAttempt}" == "true" ] ; then
if [[ "${finalAttempt}" == "true" ]] ; then
failedRetryDownload "${remote_url}" "" ""
fi
return 1
@ -293,7 +293,7 @@ dosya_FetchFileInfo() {
continue
fi
else
if [ ! -z $dosya_token_url ]; then
if [[ ! -z "$dosya_token_url" ]]; then
rm -f ${dosya_cookie_jar};
if ((j > 1)) ; then
printf "\\n"
@ -307,7 +307,7 @@ dosya_FetchFileInfo() {
printf "\\n"
fi
echo -e "${RED}|Dosya url not found${NC}"
if [ "${finalAttempt}" == "true" ] ; then
if [[ "${finalAttempt}" == "true" ]] ; then
failedRetryDownload "${remote_url}" "" ""
fi
return 1
@ -329,7 +329,7 @@ dosya_FetchFileInfo() {
printf "\\n"
fi
echo -e "${RED}| No response. Try again later."
if [ "${finalAttempt}" == "true" ] ; then
if [[ "${finalAttempt}" == "true" ]] ; then
failedRetryDownload "${remote_url}" "" ""
fi
return 1
@ -344,20 +344,20 @@ dosya_FetchFileInfo() {
fi
fi
done #head
if [ ! -z $dosya_token_url ]; then
if [[ ! -z "$dosya_token_url" ]]; then
rm -f "${dosya_cookie_jar}";
break
fi
done #fetch
touch ${WorkDir}/.flocks/${remote_url//[^a-zA-Z0-9]/}
if [ ! "$filename_override" == "" ] ; then
touch "${WorkDir}/.flocks/${remote_url//[^a-zA-Z0-9]/}"
if [[ ! "$filename_override" == "" ]] ; then
filename="$filename_override"
else
filename=$dosya_fname
fi
filename=$(sanitize_file_or_folder_name "${filename}")
if [ -z $file_size_bytes ] ; then
if [ "${finalAttempt}" == "true" ] ; then
if [[ -z $file_size_bytes ]] ; then
if [[ "${finalAttempt}" == "true" ]] ; then
failedRetryDownload "${remote_url}" "Filesize not found!" ""
fi
echo -e "${YELLOW}| Filesize not found… retry${NC}"
@ -387,18 +387,18 @@ dosya_GetFile() {
retryCnt=$2
finalAttempt=$3
flockDownload="${WorkDir}/.flocks/${filename//[^a-zA-Z0-9\.\_\-]/}.flock"
if [ "${DebugAllEnabled}" == "true" ] ; then
if [[ "${DebugAllEnabled}" == "true" ]] ; then
debugHtml "${remote_url##*/}" "dos_down_UA" "User-Agent: ${RandomUA}"
fi
for ((j=1; j<=$MaxDownloadRetries; j++)); do
pd_presize=0
if [ -f "$file_path" ] ; then
if [[ -f "$file_path" ]] ; then
pd_presize=$(stat --format="%s" "$file_path" | tr -d '[:space:]')
fi
GetRandomUA
CLEANSTRING=${remote_url//[^a-zA-Z0-9]/}
trap "rm -f ${WorkDir}/.flocks/${CLEANSTRING}; rm -f $flockDownload; echo ""; tput cnorm; exit" 0 1 2 3 6 15
if [ "${RateMonitorEnabled}" == "true" ]; then
if [[ "${RateMonitorEnabled}" == "true" ]]; then
tor_curl_request -L -G --insecure \
-H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/jxl,image/webp,*/*;q=0.8" \
-H "Accept-Language: en-US,en;q=0.5" \
@ -430,7 +430,7 @@ dosya_GetFile() {
"$download_url" --continue-at - --output "$file_path"
fi
received_file_size=0
if [ -f "$file_path" ] ; then
if [[ -f "$file_path" ]] ; then
received_file_size=$(stat --format="%s" "$file_path" | tr -d '[:space:]')
fi
if CheckNoHtml "$remote_url" "$filename" "$file_path" ; then
@ -439,9 +439,9 @@ dosya_GetFile() {
containsHtml=true
fi
downDelta=$(( received_file_size - pd_presize ))
if [[ "${received_file_size}" -ne "${file_size_bytes}" ]] || [ "$containsHtml" == "true" ]; then
if [ "${AutoRepairBadPartials}" == "true" ] && (( downDelta > 0 && downDelta < 1024 )) ; then
if [ -f "${file_path}" ] ; then
if [[ "${received_file_size}" -ne "${file_size_bytes}" ]] || [[ "$containsHtml" == "true" ]]; then
if [[ "${AutoRepairBadPartials}" == "true" ]] && (( downDelta > 0 && downDelta < 1024 )) ; then
if [[ -f "${file_path}" ]] ; then
if ((pd_presize > 0)); then
echo -e "${YELLOW}Bad node / HTML found:${NC} reverting to previous file..."
truncateDownload "$remote_url" "$filename" "$pd_presize" "$received_file_size"
@ -454,15 +454,15 @@ dosya_GetFile() {
if ((j >= $MaxDownloadRetries)) ; then
rm -f "${dosya_cookie_jar}";
rm -f "$flockDownload";
if [ "${finalAttempt}" == "true" ] ; then
if [[ "${finalAttempt}" == "true" ]] ; then
droppedSizeBadDownload "${remote_url}" "${filename}" "${received_file_size}"
fi
return 1
else
continue
fi
elif [ "${AutoRepairBadPartials}" == "true" ] && [ "$containsHtml" == "true" ] ; then
if [ -f "${file_path}" ] ; then
elif [[ "${AutoRepairBadPartials}" == "true" ]] && [[ "$containsHtml" == "true" ]] ; then
if [[ -f "${file_path}" ]] ; then
if ((pd_presize > 0)); then
echo -e "${YELLOW}Bad node / HTML found:${NC} reverting to previous file..."
truncateDownload "$remote_url" "$filename" "$pd_presize" "$received_file_size"
@ -475,22 +475,22 @@ dosya_GetFile() {
if ((j >= $MaxDownloadRetries)) ; then
rm -f "${dosya_cookie_jar}";
rm -f "$flockDownload";
if [ "${finalAttempt}" == "true" ] ; then
if [[ "${finalAttempt}" == "true" ]] ; then
droppedSizeBadDownload "${remote_url}" "${filename}" "${received_file_size}"
fi
return 1
else
continue
fi
elif (( downDelta > 0 && downDelta < 1024 )) || [ "$containsHtml" == "true" ] ; then
if [ -f "$file_path" ] ; then
elif (( downDelta > 0 && downDelta < 1024 )) || [[ "$containsHtml" == "true" ]] ; then
if [[ -f "$file_path" ]] ; then
rm -rf "$file_path"
fi
echo -e "\n${YELLOW}Bad node / HTML found:${NC} tainted partial removed..."
if ((j >= $MaxDownloadRetries)) ; then
rm -f "${dosya_cookie_jar}";
rm -f "$flockDownload";
if [ "${finalAttempt}" == "true" ] ; then
if [[ "${finalAttempt}" == "true" ]] ; then
droppedSizeBadDownload "${remote_url}" "${filename}" "${received_file_size}"
fi
return 1
@ -503,7 +503,7 @@ dosya_GetFile() {
if ((j >= $MaxDownloadRetries)) ; then
rm -f "${dosya_cookie_jar}";
rm -f "$flockDownload";
if [ "${finalAttempt}" == "true" ] ; then
if [[ "${finalAttempt}" == "true" ]] ; then
droppedSizeBadDownload "${remote_url}" "${filename}" "${received_file_size}"
fi
return 1