# 2024.11.18 - [up_fileditch / fileditch] Add fileditch.com as upload and download host

# 2024.11.17 - [innocent] Fix "Fetching file info". Support resume downloads.
# 2024.11.16 - [mad] Fix reload on uploads.txt modified (uploads: filemode)
# 2024.11.16 - [up_*] Fix removal of upload ticket if filesize is not supported
# 2024.11.15 - [familleflender] Add famille-flender.fr as download host
# 2024.11.15 - [up_familleflender] Add famille-flender.fr as upload host
# 2024.11.15 - [up_filehaus] Finish the uploader (the server is back online)
This commit is contained in:
kittykat 2024-11-18 14:48:48 +00:00
parent d3d08d63f5
commit fa83163a58
Signed by: kittykat
GPG key ID: E3F1556620F70C3C
101 changed files with 1648 additions and 790 deletions

85
mad.sh
View file

@ -31,9 +31,16 @@
# * klonkerz - feedback and suggestions, url only processing
# * Everyone who provided feedback and helped test.. and those who wish to remain anonymous
ScriptVersion=2024.11.14
ScriptVersion=2024.11.18
#=================================================
# Recent Additions
# 2024.11.18 - [up_fileditch / fileditch] Add fileditch.com as upload and download host
# 2024.11.17 - [innocent] Fix "Fetching file info". Support resume downloads.
# 2024.11.16 - [mad] Fix reload on uploads.txt modified (uploads: filemode)
# 2024.11.16 - [up_*] Fix removal of upload ticket if filesize is not supported
# 2024.11.15 - [familleflender] Add famille-flender.fr as download host
# 2024.11.15 - [up_familleflender] Add famille-flender.fr as upload host
# 2024.11.15 - [up_filehaus] Finish the uploader (the server is back online)
# 2024.11.14 - [up_skrepr, skrepr] Add transfer.skrepr.com as upload and download host
# 2024.11.13 - [up_pixeldrain] Add pixeldrain as an upload host
# 2024.11.13 - [mad] Add pixeldrain apikey section to allow pd uploads
@ -2755,7 +2762,7 @@ MadUploadFromFileTxt() {
if DoneProcessingAllUrls "${InputFile}" ; then
if [ "${AutoShowMadStatus}" == "true" ] ; then
echo -e "${RED}${GREEN}Done! ${YELLOW}Me0W!${NC} :D"
madStatus "${InputFile}"
madStatusUploads "${InputFile}"
fi
exit 0
else
@ -2766,10 +2773,25 @@ MadUploadFromFileTxt() {
lockCount=0
sed 's/^[[:space:]]*// ; s/[[:space:]]*$//' "${InputFile}" |
while IFS= read -r line
do
filepath=""
filename=""
hostcode=""
do
if [ -f "${InputFile}" ] ; then
currentHashFilelistTxt=$( sha1sum "${InputFile}" | awk '{print $1}' )
else
currentHashFilelistTxt=$( sha1sum ${InputFile} | awk '{print $1}' )
fi
if ((qChkLineCount > 0)) && [ ! "${HashFilelistTxt}" == "${currentHashFilelistTxt}" ]; then
printf "\\n%s\\n" "--------------------------------------------"
printf "[${PINK}Reload${NC}] ${InputFile} was modified.\\n"
printf "%s\\n" "--------------------------------------------"
HashFilelistTxt="$currentHashFilelistTxt"
mainLoopControl=false
exec "$0" "upload" "${InputFile}"
exit 1
fi
upfile_filepath=""
upfile_filename=""
upfile_hostcode=""
upfile_fsize=0
line="${line//[$'\t\r\n']}"
if [[ ${line} =~ ^# ]] ; then
continue
@ -2777,15 +2799,17 @@ MadUploadFromFileTxt() {
continue
fi
if [[ $line =~ \| ]] ; then
upfile_hostcode="${line##*\|}"
upfile_filepath="${line%%\|*}"
upfile_hostcode="${line##*\|}"
else
continue
fi
if [ ! -f "$upfile_filepath" ]; then
upfile_filepath="${WorkDir}/uploads/$upfile_filepath"
fi
upfile_filename="${upfile_filepath##*\/}"
upfile_fsize=$(GetFileSize "$upfile_filepath" "false")
if [ ! -f "$upfile_filepath" ] || ((upfile_fsize <= 0)) ; then
if [ ! -f "$upfile_filepath" ] || ((upfile_fsize <= 0)) ; then
uploadBadInputLine "$line" "Bad input line (file: $upfile_filepath, size: $upfile_fsize)"
continue
fi
@ -2793,41 +2817,6 @@ MadUploadFromFileTxt() {
uploadBadInputLine "$line" "Bad input line (check filename and hostcode are valid)"
continue
fi
if [ -f "${InputFile}" ] ; then
currentHashFilelistTxt=$( sha1sum "${InputFile}" | awk '{print $1}' )
else
currentHashFilelistTxt=$( sha1sum ${InputFile} | awk '{print $1}' )
fi
linematch=""
if [ -f "${WorkDir}/uploads/temp_upload_handler.txt" ]; then
linematch=$(grep -Eni -m 1 "[OK].*file:.*${tfilename}.*host:.*${userentry_hostcode}.*\$" "${WorkDir}/uploads/temp_upload_handler.txt")
if [ ! -z "$linematch" ] ; then
echo -e ""
echo -e "${GREEN}$tfilename${NC} already uploaded to ${userentry_hostcode} in ${GREEN}temp_upload_handler.txt${NC}"
echo -e "${BLUE}line${NC}: ${linematch//, /\\n}"
echo -e ""
successUploadExists "$tfilename" "$userentry_hostcode" "File/Host (OK) found in ./uploads/temp_upload_handler.txt (line#: ${linematch%%:*})"
continue
fi
linematch=$(grep -Eni -m 1 "[FAIL].*file:.*${tfilename}.*host:.*${userentry_hostcode}.*\$" "${WorkDir}/uploads/temp_upload_handler.txt")
if [ ! -z "$linematch" ] ; then
echo -e ""
echo -e "${GREEN}$tfilename${NC} already failed upload to ${userentry_hostcode} in ${GREEN}temp_upload_handler.txt${NC}"
echo -e "${BLUE}line${NC}: ${linematch//, /\\n}"
echo -e ""
skipfailedUpload "$pline" "$tfilename" "$userentry_hostcode" "File/Host (FAIL) found in ./uploads/temp_upload_handler.txt (line#: ${linematch%%:*})"
continue
fi
linematch=$(grep -Eni -m 1 "[RETRY].*file:.*${tfilename}.*host:.*${userentry_hostcode}.*\$" "${WorkDir}/uploads/temp_upload_handler.txt")
if [ ! -z "$linematch" ] ; then
echo -e ""
echo -e "${GREEN}$tfilename${NC} already failed upload to ${userentry_hostcode} in ${GREEN}temp_upload_handler.txt${NC}"
echo -e "${BLUE}line${NC}: ${linematch//, /\\n}"
echo -e ""
skipfailedUpload "$pline" "$tfilename" "$userentry_hostcode" "File/Host (FAIL or RETRY) found in ./uploads/temp_upload_handler.txt (line#: ${linematch%%:*})"
continue
fi
fi
UploadTicket="${WorkDir}/.flocks/upload_${upfile_hostcode}_${upfile_filepath//[^a-zA-Z0-9]/}"
if [ -f "$UploadTicket" ]; then
echo -e "${YELLOW}Lock Exists (Skipping)${NC}: ./.flocks/upload_${upfile_hostcode}_${upfile_filepath//[^a-zA-Z0-9]/}"
@ -2861,7 +2850,7 @@ MadUploadFromFileTxt() {
done
done #loop through the file line by line
qChkLineCount=$(grep -Evi '^#|^$|#OK#|#FAIL#|#RETRY#)' "${InputFile}" | wc -l | awk '{ print $1 }')
if ((qChkLineCount > 0)) ; then
if ((qChkLineCount > 0)) ; then
if [ "$LoopThroughFileUntilComplete" == "false" ]; then
echo -e "${NC}"
echo -e "${YELLOW}Unprocessed / Skipped File / HostCode(s) Found:${NC}"
@ -3019,7 +3008,7 @@ MadUploadFilesInUploadsFolder() {
userentry_hostcode=$(TrimWhitespace "$hline")
linematch=""
if [ -f "${WorkDir}/uploads/temp_upload_handler.txt" ]; then
linematch=$(grep -Eni -m 1 "[OK].*file:.*${tfilename}.*host:.*${userentry_hostcode}.*\$" "${WorkDir}/uploads/temp_upload_handler.txt")
linematch=$(grep -Eni -m 1 "[OK] file: ${tfilename}, host: ${userentry_hostcode},.*\$" "${WorkDir}/uploads/temp_upload_handler.txt")
if [ ! -z "$linematch" ] ; then
echo -e ""
echo -e "${GREEN}$tfilename${NC} already uploaded to ${userentry_hostcode} in ${GREEN}temp_upload_handler.txt${NC}"
@ -3028,7 +3017,7 @@ MadUploadFilesInUploadsFolder() {
successUploadExists "$tfilename" "$userentry_hostcode" "File/Host (OK) found in ./uploads/temp_upload_handler.txt (line#: ${linematch%%:*})"
continue
fi
linematch=$(grep -Eni -m 1 "[FAIL].*file:.*${tfilename}.*host:.*${userentry_hostcode}.*\$" "${WorkDir}/uploads/temp_upload_handler.txt")
linematch=$(grep -Eni -m 1 "[FAIL] file: ${tfilename}, host: ${userentry_hostcode},.*\$" "${WorkDir}/uploads/temp_upload_handler.txt")
if [ ! -z "$linematch" ] ; then
echo -e ""
echo -e "${GREEN}$tfilename${NC} already failed upload to ${userentry_hostcode} in ${GREEN}temp_upload_handler.txt${NC}"
@ -3037,7 +3026,7 @@ MadUploadFilesInUploadsFolder() {
skipfailedUpload "$pline" "$tfilename" "$userentry_hostcode" "File/Host (FAIL) found in ./uploads/temp_upload_handler.txt (line#: ${linematch%%:*})"
continue
fi
linematch=$(grep -Eni -m 1 "[RETRY].*file:.*${tfilename}.*host:.*${userentry_hostcode}.*\$" "${WorkDir}/uploads/temp_upload_handler.txt")
linematch=$(grep -Eni -m 1 "[RETRY] file: ${tfilename}, host: ${userentry_hostcode},.*\$" "${WorkDir}/uploads/temp_upload_handler.txt")
if [ ! -z "$linematch" ] ; then
echo -e ""
echo -e "${GREEN}$tfilename${NC} already failed upload to ${userentry_hostcode} in ${GREEN}temp_upload_handler.txt${NC}"
@ -3107,7 +3096,7 @@ direct_FetchFileInfo() {
tor_identity="${RANDOM}"
if ((j % 2 == 0)); then
printf "| Retrieving Get/Head: attempt #$j"
file_header=$(tor_curl_request --insecure -m 18 -s -D - -o /dev/null \
file_header=$(tor_curl_request --insecure -m 8 -s -D - -o /dev/null \
-H "Connection: keep-alive" \
-w 'EffectiveUrl=%{url_effective}' \
"$download_url")