# 2024.12.26 - [up_kouploader / up_axfc / up_torup] Fixed failedRetryUpload (was using download logging)

#               * Thanks Belky
# 2024.12.26 - [anonfile / up_anonfile] Add anonfile.de as upload / download host
# 2024.12.25 - [dashfile / up_dashfile] Add dashfile.net as upload / download host
# 2024.12.25 - [isupload] Change to use tor_curl_request_extended (server response is often slow)
#               - Accept 200 OK response to continue (do not require filename / filesize)
# 2024.12.25 - [fileblade] Add response handling for free file download dissallowed > 100MB.
#               "The file owner does not allow FREE users to download files which are over 100 MB"
# 2024.12.25 - [mad] Add "UploadHiveRandomizeExt" option to config with default=true
# 2024.12.25 - [uploadhive / up_uploadhive] Update renaming random ext files to their original names
#               - Handle multipart 7z & rar (abc.7z.###, abc.part#.rar)
# 2024.12.25 - [syspro / up_syspro] Add share.syspro.com.br as upload / download host
# 2024.12.24 - [mad] Add EnabledUploadHosts / EnabledDownloadHosts setting to fine-tune which hosts to use
#               ** Options: recommended, online, all (Default=recommended)
#               - recommended: loads all hosts verified working with MAD
#               - online: loads all hosts available online / working (includes captcha / js restricted)
#               - all: loads all hosts in hosts folder
# 2024.12.24 - [up_ateasystems / ateasystems] Add share.ateasystems.com as upload / download host
# 2024.12.23 - [up_uploadbay / uploadbay] Add uploadbay.net as upload / download host
# 2024.12.23 - [up_herbolistique / herbolistique] Add transfert.herbolistique.com as upload / download host
# 2024.12.23 - [uploadhive] Auto-rename random extension downloads
# 2024.12.23 - [up_uploadhive] Change upload file extension to random 3 letters (uhive blocks .7z, .zip, .rar now)
# 2024.12.23 - [up_offshorecat] Fixed upload. Updated apikey.
# 2024.12.23 - [up_fileditch] Fixed upload. Added response handling for Tor Blocked node (retries)
# 2024.12.23 - [up_freesocial / freesocial] Add files.freesocial.co as upload / download host
# 2024.12.23 - [up_cyssoux / cyssoux] Add partage.cyssoux.fr as upload / download host
# 2024.12.22 - [mad] Add jira_Upload function -- used for all jirafeau hosts
# 2024.12.22 - [up_*AllJiraHosts*] Consolidated / moved all hosts upload functions to mad.sh
#               - Minimized jira host code (~6000 lines of duplicates removed)
#               - Jira hosts: acid, anarchaserver, depotkaz, dictvm, eddowding, familleflender, filesquid,
#                 free4e, harrault, linxx, moocloud, nantes, netlib, skrepr, soyjak
# 2024.12.20 - [fileblade / up_fileblade] Add fileblade.com as upload / download host
# 2024.12.20 - [isupload / up_isupload] Add isupload.com as upload / download host
# 2024.12.15 - [mediafire] Add mediafire download link processing
# 2024.12.12 - [dictvm / up_dictvm] Add dictvm.org as upload / download host
# 2024.12.12 - [eddowding / up_eddowding] Add eddowding.com as upload / download host
# 2024.12.12 - [up_pixeldrain] Modify upload to use PUT
# 2024.12.12 - [mad] Update pixeldrain api key
# 2024.12.09 - [ranoz] Fix filenames with spaces
# 2024.11.29 - [innocent] Update to use tor_curl_request_extended for head/get
# 2024.11.29 - [quax] Update 404 Not found response handling
This commit is contained in:
kittykat 2024-12-27 19:47:09 +00:00
parent ec7d121c0e
commit e6804e01e1
Signed by: kittykat
GPG key ID: E3F1556620F70C3C
58 changed files with 6609 additions and 2223 deletions

313
mad.sh
View file

@ -31,73 +31,54 @@
# * klonkerz - feedback and suggestions, url only processing
# * Everyone who provided feedback and helped test.. and those who wish to remain anonymous
ScriptVersion=2024.11.28
ScriptVersion=2024.12.26
#=================================================
# Recent Additions
# 2024.12.26 - [up_kouploader / up_axfc / up_torup] Fixed failedRetryUpload (was using download logging)
# * Thanks Belky
# 2024.12.26 - [anonfile / up_anonfile] Add anonfile.de as upload / download host
# 2024.12.25 - [dashfile / up_dashfile] Add dashfile.net as upload / download host
# 2024.12.25 - [isupload] Change to use tor_curl_request_extended (server response is often slow)
# - Accept 200 OK response to continue (do not require filename / filesize)
# 2024.12.25 - [fileblade] Add response handling for free file download dissallowed > 100MB.
# "The file owner does not allow FREE users to download files which are over 100 MB"
# 2024.12.25 - [mad] Add "UploadHiveRandomizeExt" option to config with default=true
# 2024.12.25 - [uploadhive / up_uploadhive] Update renaming random ext files to their original names
# - Handle multipart 7z & rar (abc.7z.###, abc.part#.rar)
# 2024.12.25 - [syspro / up_syspro] Add share.syspro.com.br as upload / download host
# 2024.12.24 - [mad] Add EnabledUploadHosts / EnabledDownloadHosts setting to fine-tune which hosts to use
# ** Options: recommended, online, all (Default=recommended)
# - recommended: loads all hosts verified working with MAD
# - online: loads all hosts available online / working (includes captcha / js restricted)
# - all: loads all hosts in hosts folder
# 2024.12.24 - [up_ateasystems / ateasystems] Add share.ateasystems.com as upload / download host
# 2024.12.23 - [up_uploadbay / uploadbay] Add uploadbay.net as upload / download host
# 2024.12.23 - [up_herbolistique / herbolistique] Add transfert.herbolistique.com as upload / download host
# 2024.12.23 - [uploadhive] Auto-rename random extension downloads
# 2024.12.23 - [up_uploadhive] Change upload file extension to random 3 letters (uhive blocks .7z, .zip, .rar now)
# 2024.12.23 - [up_offshorecat] Fixed upload. Updated apikey.
# 2024.12.23 - [up_fileditch] Fixed upload. Added response handling for Tor Blocked node (retries)
# 2024.12.23 - [up_freesocial / freesocial] Add files.freesocial.co as upload / download host
# 2024.12.23 - [up_cyssoux / cyssoux] Add partage.cyssoux.fr as upload / download host
# 2024.12.22 - [mad] Add jira_Upload function -- used for all jirafeau hosts
# 2024.12.22 - [up_*AllJiraHosts*] Consolidated / moved all hosts upload functions to mad.sh
# - Minimized jira host code (~6000 lines of duplicates removed)
# - Jira hosts: acid, anarchaserver, depotkaz, dictvm, eddowding, familleflender, filesquid,
# free4e, harrault, linxx, moocloud, nantes, netlib, skrepr, soyjak
# 2024.12.20 - [fileblade / up_fileblade] Add fileblade.com as upload / download host
# 2024.12.20 - [isupload / up_isupload] Add isupload.com as upload / download host
# 2024.12.15 - [mediafire] Add mediafire download link processing
# 2024.12.12 - [dictvm / up_dictvm] Add dictvm.org as upload / download host
# 2024.12.12 - [eddowding / up_eddowding] Add eddowding.com as upload / download host
# 2024.12.12 - [up_pixeldrain] Modify upload to use PUT
# 2024.12.12 - [mad] Update pixeldrain api key
# 2024.12.09 - [ranoz] Fix filenames with spaces
# 2024.11.29 - [innocent] Update to use tor_curl_request_extended for head/get
# 2024.11.29 - [quax] Update 404 Not found response handling
# 2024.11.27 - [up_ranoz] Modify download link to not use the upload url ticket link
# 2024.11.26 - [filehaus] Handle "404 Not found" on first instance
# 2024.11.25 - [up_moocloud / moocloud] Add moocloud.ch as an upload and download host
# 2024.11.24 - [uploadhive] Handle "Error creating download link" response -- do not mark Removed
# 2024.11.23 - [filehaus] Use tor_curl_request_extended for head / get for filehaus urls
# 2024.11.23 - [mad] Make tor_curl_request_extended a random timeout between 30-60 seconds
# 2024.11.22 - [up_quax, quax] Add qu.ax as an upload and download host
# 2024.11.21 - [filedot] Fix check for post filename
# 2024.11.20 - [gofile] Handle parsing parent gofile url into multiple download urls
# (still needs updating to handle child urls gofile.io/download/web/<guid>/file)
# 2024.11.19 - [mad] Add updateUrlDownload function to handle updating a url
# (ie. parent gofile url with children urls)
# 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
# 2024.11.13 - [up_filesquid] Add "No password nor allowed IP" response handling
# 2024.11.12 - [mad] Fix uploads.txt status marking (urls / messages) containg '&' chars
# 2024.11.12 - [up_torup] Max upload filesize changed to 150MB
# 2024.11.12 - [up_uploadee] Add upload.ee as an upload host
# 2024.11.11 - [up_offcat] Add Offshore.cat as upload host
# 2024.11.11 - [mad] Add OffShore.cat Upload ApiKeys section to allow using Offshore.cat as upload host
# 2024.11.10 - [mad] Fix uploads.txt multi-terminal processing (use /uploads/temp_upload_handler.txt)
# 2024.11.10 - [1fichier] Add new "has been automatically deleted after its free hosting period expired"
# 2024.11.10 - [up_torup] Add TorUp as an upload host
# 2024.11.09 - [torup] Add TorUp as a download host (no resume)
# (https://ktgzpea2b76u7fgemiibp4a76onyybo4fw5gbsagtm6jrjzmgivppyyd.onion.tor.my)
# 2024.11.08 - [nippy] Fix nippydrive.com. Update detection of temporarily unavailable response.
# 2024.11.08 - [up2share] Fix download url (https)
# 2024.11.08 - [up2share] Fix advertised filesize on a redirection
# 2024.11.06 - [SkipUrlsInDownloadsCompletedTxt] Fix blank url check
# 2024.11.06 - [ranoz] Add ranoz.gg as download host
# 2024.11.05 - [up_ranoz] Add ranoz.gg as upload host
# 2024.11.02 - [innocent] Disable rate monitor on download
# 2024.11.02 - [mad, innocent] Add 18s timeout on HEAD (get hack) for no response from host
# 2024.11.01 - [up_uploadhive] Add uploadhive as upload host
# 2024.11.01 - [innocent] Switch between 3 alternate head type attempts
# 2024.10.30 - [uploadev] Add additional file removed response handling
# 2024.10.30 - [anonsharing] Add AnonSharing.com as download host (only processes urls with fileid)
# 2024.10.29 - [kraken] Add recaptcha response handling
# 2024.10.29 - [bowfile] Add File has been removed by the site administrator response
# 2024.10.29 - [up_anonsharing] Add AnonSharing.com as upload host (unique url with fileid)
# 2024.10.29 - [uploadev] Add UploadEv.org as download host
# 2024.10.27 - [up_uploadev] Add UploadEv.org as upload host
# 2024.10.25 - [dosya] Add check for too many failed responses. try again later.
# 2024.10.24 - [bedrive / up_bedrive] Add bedrive.ru as download / upload host
# 2024.10.24 - [mad] Add pw: and ref: keyword values to ./data/downloads_completed.txt logging
# 2024.10.24 - [mad] Add extended connection-timeout request (tor_curl_request_extended)
# 2024.10.24 - [dosya] Use extended connection-timeout request for HEAD
# 2024.10.23 - [mad] Fix PostFailedUpload function call
# 2024.10.22 - [innocent / up_innocent] Add innocent.onion as download / upload host
# * Current download does not support resume
# 2024.10.22 - [mad] Few updates to direct download
# 2024.10.21 - [nippy] Update nippy to handle dbree (.me, .org)
# 2024.10.21 - [dbree] Add dbree.org
# 2024.10.17 - [dailyuploads] Add recaptcha detection and abort (js required)
# * Working on possible PJSCloud solution
# 2024.10.16 - [mad] Remove tor_curl_upload duplicate connect-timeout (thanks PeachX)
# -- See ./documentation/!Changelog (Historical).txt for further changes -- #
@ -156,6 +137,15 @@ RateMonitorEnabled=true
# @MyCurrent="pjscloud.sh,ocr_captcha.sh,SkipUrlsInDownloadsCompletedTxt.sh"
LoadPlugins=""
# Enabled Hosts: (Upload / Download) [ "recommended", "online", "all" ]
# -- Last Checked / Updated: 2024.12.23
# -- Available options --
# * "recommended" -- Loads hosts that currently work with MAD
# * "online" -- Loads hosts that are available online (includes captcha / js restricted)
# * "all" -- Loads all hosts (blank/unknown is also "all")
# @Default="recommended" (only load hosts that are verified working with MAD)
EnabledUploadHosts="recommended"
EnabledDownloadHosts="recommended"
#=================================================
# UPLOAD SECTION
@ -167,7 +157,7 @@ MaxUploadRetries=4
# Selected upload hosts
# @Default=1f,uhive,oshi
DefaultUploadHosts='1f,uhive,oshi'
DefaultUploadHosts='1f,oshi,gofile'
# [RateMonitor - UploadSpeedMin]: Minimum required Upload Speed in bytes (used in coordination with UploadTimeoutInterval)
# This helps ensure an upload doesn't go stale and hit a speed of 0 for too long. (! Requires RateMonitorEnabled=true)
@ -178,8 +168,8 @@ UploadSpeedMin=10
# [RateMonitor - UploadTimeoutInterval]: Amount of time in seconds a transfer can remain below the UploadSpeedMin before it will timeout.
# This helps ensure an upload doesn't go stale and hit a speed of 0 for too long. (! Requires RateMonitorEnabled=true)
# ie. curl: (28) Operation too slow. Less than 5000 bytes/sec transferred the last 60 seconds
# @Default=600 (10 min)
UploadTimeoutInterval=600
# @Default=300 (5 min)
UploadTimeoutInterval=300
#=================================================
@ -273,6 +263,10 @@ CatnapDuration=1
# HOST SPECIFIC SECTION
#-------------------
# [uploadhive]: Randomize extension (bypass 7z, zip, tar block)
# [{"file_code":"undef","file_status":"unallowed extension"}]
UploadHiveRandomizeExt=true
# [Oshi]: Control BaseUrl Override (none, oshiat, oshionion)
# none: Will download from whatever url base is passed in
# oshiat: Will convert all oshi urls to oshi.at (clearnet, faster)
@ -305,7 +299,7 @@ ar_fdUP[0]="user1|pass1"
# - Setup free accounts: https://files.offshore.cat/register (use any username/pass - not verified)
# - Get apikey: https://files.offshore.cat/dashboard/account (use login created above)
# - The accounts are randomly selected for every download.
ar_oscKey[0]='CJZaU3yCQXZrozRmgXOLHjKqP1bbqbvEbJgOZig53WRgEHFHRTh5kIbEWbhEdyLq' # Shared general
ar_oscKey[0]='4GDsorzK4e1yowrCiZaBnS992uKjiZVnXbByJr0kHmaAxarP26LkRV79MbKACXt0' # Shared general
#ar_oscKey[1]='apikey' # Uncomment line to use a 2nd
#ar_oscKey[2]='apikey' # Uncomment line to use a 3rd
#ar_oscKey[3]='apikey' # Uncomment line to use a 4th
@ -317,7 +311,7 @@ ar_oscKey[0]='CJZaU3yCQXZrozRmgXOLHjKqP1bbqbvEbJgOZig53WRgEHFHRTh5kIbEWbhEdyLq'
# - Setup free accounts:https://pixeldrain.com/register (use any username/pass - not verified)
# - Get apikey: https://pixeldrain.com/user/api_keys (use login created above)
# - The accounts are randomly selected for every download.
ar_pdKey[0]='6a7c5c4e-aeb4-45ab-a11b-96799da02922' # Shared general
ar_pdKey[0]='cad31e7f-676d-4d47-a41b-b32087bee0c2' # Shared general
#ar_pdKey[1]='apikey' # Uncomment line to use a 2nd
#ar_pdKey[2]='apikey' # Uncomment line to use a 3rd
#ar_pdKey[3]='apikey' # Uncomment line to use a 4th
@ -424,6 +418,44 @@ tor_curl_upload() {
fi
fi
}
SetEnabledUploadHosts() {
if [[ "$EnabledUploadHosts" == "recommended" ]] ; then
lstEnabledUploadHosts="up_1fichier,up_anonsharing,up_axfc,up_bowfile,up_depotkaz,up_familleflender,"
lstEnabledUploadHosts+="up_fileblade,up_fileditch,up_firestorage,up_free4e,up_gofile,up_harrault,"
lstEnabledUploadHosts+="up_isupload,up_kouploader,up_moocloud,up_nantes,up_offshorecat,up_oshi,"
lstEnabledUploadHosts+="up_pixeldrain,up_quax,up_ranoz,up_skrepr,up_torup,up_turboonion,up_uploadee,"
lstEnabledUploadHosts+="up_uploadhive,up_uploadraja,up_herbolistique,up_uploadbay,up_ateasystems,up_syspro,"
lstEnabledUploadHosts+="up_dashfile,up_anonfile"
elif [[ "$EnabledUploadHosts" == "online" ]] ; then
lstEnabledUploadHosts="up_1fichier,up_anonsharing,up_axfc,up_bedrive,up_bowfile,up_depotkaz,"
lstEnabledUploadHosts+="up_familleflender,up_fileblade,up_fileditch,up_firestorage,up_free4e,up_gofile,"
lstEnabledUploadHosts+="up_harrault,up_hexload,up_isupload,up_kouploader,up_kraken,up_moocloud,up_nantes,"
lstEnabledUploadHosts+="up_nippy,up_nofile,up_offshorecat,up_oshi,up_pixeldrain,up_quax,up_ranoz,"
lstEnabledUploadHosts+="up_shareonline,up_skrepr,up_torup,up_turboonion,up_uploadee,up_uploadhive,"
lstEnabledUploadHosts+="up_uploadraja,up_yolobit,up_herbolistique,up_uploadbay,up_ateasystems,up_syspro,"
lstEnabledUploadHosts+="up_dashfile,up_anonfile"
fi
}
SetEnabledDownloadHosts() {
if [[ "$EnabledDownloadHosts" == "recommended" ]] ; then
lstEnabledDownloadHosts="1fichier,acid,anarchaserver,anonsharing,biteblob,bowfile,cyssoux,dataupload,"
lstEnabledDownloadHosts+="depotkaz,dictvm,downloadgg,eddowding,eternalhosting,familleflender,fileblade,"
lstEnabledDownloadHosts+="fileditch,filedoge,filedot,filehaus,filesquid,firestorage,free4e,freesocial,"
lstEnabledDownloadHosts+="gofile,harrault,innocent,isupload,lainsafe,lainsafe_onion,linxx,mediafire,"
lstEnabledDownloadHosts+="moocloud,nantes,netlib,offshorecat,oshi,pixeldrain,quax,ranoz,skrepr,"
lstEnabledDownloadHosts+="tempfileme,tempsh,torup,turboonion,up2share,uploadee,uploadev,uploadhive,"
lstEnabledDownloadHosts+="youdbox,herbolistique,uploadbay,ateasystems,syspro,dashfile,anonfile"
elif [[ "$EnabledDownloadHosts" == "online" ]] ; then
lstEnabledDownloadHosts="1fichier,anonsharing,bedrive,biteblob,bowfile,click,cyssoux,"
lstEnabledDownloadHosts+="dailyuploads,dataupload,depotkaz,dictvm,dosya,downloadgg,eddowding,eternalhosting,"
lstEnabledDownloadHosts+="familleflender,fileblade,fileditch,filedoge,filedot,firestorage,"
lstEnabledDownloadHosts+="free4e,gofile,harrault,hexload,isupload,kraken,lainsafe,"
lstEnabledDownloadHosts+="lainsafe_onion,mediafire,moocloud,nantes,netlib,nippy,nofile,offshorecat,"
lstEnabledDownloadHosts+="oshi,pixeldrain,quax,ranoz,shareonline,skrepr,tempfileme,tempsh,torup,"
lstEnabledDownloadHosts+="turboonion,up2share,uploadee,uploadev,uploadhive,yolobit,youdbox,herbolistique,"
lstEnabledDownloadHosts+="uploadbay,ateasystems,syspro,dashfile,anonfile"
fi
}
GetRandomFiledotUser() {
arrSize=${#ar_fdUP[@]}
index=$(($RANDOM % $arrSize))
@ -999,7 +1031,7 @@ successUpload() {
dateStamp=$(date '+%Y/%m/%d %H:%M:%S')
mkdir -p "${WorkDir}/data"
echo -e "$dateStamp [OK] file: ${filename}, host: ${HostCode}, dl: ${downloadLink}, ticket: ${cTicket}, size: ${filesize}, path: ${filepath}" >> "${WorkDir}/data/uploads_completed.txt"
if [ ! -z "$InputFile" ]; then
if [ ! -z "$InputFile" ] && [ ! -z "$pLine" ]; then
sed -i -e "s>^${pLine}.*>#& #OK# ${downloadLink//&/\\&}>g" "${InputFile}" #processed line
fi
dateStamp=$(date '+%Y/%m/%d %H:%M:%S')
@ -1024,7 +1056,7 @@ successUploadExists() {
mkdir -p "${WorkDir}/uploads"
dateStamp=$(date '+%Y/%m/%d %H:%M:%S')
echo -e "[EXISTS] ${filename}, ${HostCode}, ${downloadLink}" >> "${WorkDir}/uploads/results.txt"
if [ ! -z "$InputFile" ]; then
if [ ! -z "$InputFile" ] && [ ! -z "$pLine" ]; then
sed -i -e "s>^${pLine}.*>#& #OK# (Upload exists) ${message//&/\\&}>g" "${InputFile}" #processed line
fi
UploadTicket="${WorkDir}/.flocks/upload_${HostCode}_${filepath//[^a-zA-Z0-9]/}"
@ -1045,7 +1077,7 @@ failedUpload() {
mkdir -p "${WorkDir}/uploads"
dateStamp=$(date '+%Y/%m/%d %H:%M:%S')
echo -e "[FAIL] ${HostCode}, ${filename}, ${message}" >> "${WorkDir}/uploads/results.txt"
if [ ! -z "$InputFile" ]; then
if [ ! -z "$InputFile" ] && [ ! -z "$pLine" ]; then
sed -i -e "s>^${pLine}.*>#& #FAIL# ${message//&/\\&}>g" "${InputFile}" #processed line
fi
dateStamp=$(date '+%Y/%m/%d %H:%M:%S')
@ -1069,7 +1101,7 @@ failedRetryUpload() {
mkdir -p "${WorkDir}/uploads"
dateStamp=$(date '+%Y/%m/%d %H:%M:%S')
echo -e "[RETRY] ${HostCode}, ${filename}, ${message}" >> "${WorkDir}/uploads/results.txt"
if [ ! -z "$InputFile" ]; then
if [ ! -z "$InputFile" ] && [ ! -z "$pLine" ]; then
sed -i -e "s>^${pLine}.*>#& #RETRY# ${message//&/\\&}>g" "${InputFile}" #processed line
fi
dateStamp=$(date '+%Y/%m/%d %H:%M:%S')
@ -1094,7 +1126,7 @@ skipFailedUpload() {
mkdir -p "${WorkDir}/uploads"
dateStamp=$(date '+%Y/%m/%d %H:%M:%S')
echo -e "[SKIP/FAIL] ${HostCode}, ${filename}, ${message}" >> "${WorkDir}/uploads/results.txt"
if [ ! -z "$InputFile" ]; then
if [ ! -z "$InputFile" ] && [ ! -z "$pLine" ]; then
sed -i -e "s>^${pLine}.*>#& #FAIL# (Skip) ${message//&/\\&}>g" "${InputFile}" #processed line
fi
dateStamp=$(date '+%Y/%m/%d %H:%M:%S')
@ -1114,7 +1146,7 @@ uploadBadInputLine() {
mkdir -p "${WorkDir}/uploads"
dateStamp=$(date '+%Y/%m/%d %H:%M:%S')
echo -e "[BADLINE] ${pLine}${message}" >> "${WorkDir}/uploads/results.txt"
if [ ! -z "$InputFile" ]; then
if [ ! -z "$InputFile" ] && [ ! -z "$pLine" ]; then
sed -i -e "s>^${pLine}.*>#& #RETRY# (Bad Line)${message//&/\\&}>g" "${InputFile}" #processed line
fi
dateStamp=$(date '+%Y/%m/%d %H:%M:%S')
@ -1161,11 +1193,27 @@ GetRandomUA() {
LoadMadDownloadHosts() {
if [ -d "${ScriptDir}/hosts/" ]; then
echo -e "${GREEN}Loading Download Hosts...${NC}"
SetEnabledDownloadHosts
tHostFuncPrefixes=""
cnthostsloaded=0
for fil in "${ScriptDir}"/hosts/*.sh ;
do
if [ -f "$fil" ]; then
if [[ "$EnabledDownloadHosts" == "recommended" ]] || [[ "$EnabledDownloadHosts" == "online" ]] ; then
readarray -d "," -t arrEnabledHosts <<< "${lstEnabledDownloadHosts}"
isfound=false
for hostfil in "${arrEnabledHosts[@]}";
do
hostfil="${hostfil//[$'\t\r\n']}"
if [[ "${fil##*/}" == "${hostfil}.sh" ]] ; then
isfound=true
break
fi
done
if [[ "$isfound" == "false" ]]; then
continue
fi
fi
if grep -Eq '^HostFuncPrefix='"'" "$fil" ; then
tfilename="${fil##*/}"
if [[ "$tfilename" == "up_"* ]] ; then
@ -1196,11 +1244,27 @@ LoadMadDownloadHosts() {
LoadMadUploadHosts() {
if [ -d "${ScriptDir}/hosts/" ]; then
echo -e "${GREEN}Loading Upload Hosts...${NC}"
SetEnabledUploadHosts
tHostFuncPrefixes=""
cnthostsloaded=0
for fil in "${ScriptDir}"/hosts/up_*.sh ;
do
if [ -f "$fil" ]; then
if [[ "$EnabledUploadHosts" == "recommended" ]] || [[ "$EnabledUploadHosts" == "online" ]] ; then
readarray -d "," -t arrEnabledHosts <<< "${lstEnabledUploadHosts}"
isfound=false
for hostfil in "${arrEnabledHosts[@]}";
do
hostfil="${hostfil//[$'\t\r\n']}"
if [[ "${fil##*/}" == "${hostfil}.sh" ]] ; then
isfound=true
break
fi
done
if [[ "$isfound" == "false" ]]; then
continue
fi
fi
if grep -Eq '^HostFuncPrefix='"'" "$fil" ; then
tfilename="${fil##*/}"
_hostfuncprefix=$(grep -oP -m 1 '^HostFuncPrefix='"'"'\K.*?(?='"'"')' "$fil")
@ -1565,7 +1629,7 @@ install_curl_impersonate_lexiforest_fork() {
tarOutput=$(tar -xvzf ${final_tarpath} -C $extract_location)
rm -f "${ScriptDir}"/curl*
mv "$extract_location/curl-impersonate-chrome" "${ScriptDir}/"
mv "$extract_location/curl_chrome124" "${ScriptDir}/"
mv "$extract_location/curl_chrome131" "${ScriptDir}/"
echo -e "${GREEN}| Done.${NC} Update ${BLUE}\"UseTorCurlImpersonate=true\"${NC} in script to use..."
exit 0
else
@ -3441,6 +3505,109 @@ direct_DownloadFile() {
done
rm -f "${WorkDir}/.flocks/${remote_url//[^a-zA-Z0-9]/}"
}
jira_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]/}"
fsize=$(GetFileSize "$filepath" "false")
if ((fsize > jira_MaxUploadSizeInBytes)); then
rm -f "${UploadTicket}"
echo -e "${YELLOW}| SKIP${NC}: The size of $filename is to large for $_hostCode. ($fsize > $jira_MaxUploadSizeInBytes)"
failedUpload "$pline" "${filepath}" "${_hostCode}" "Skipping upload. The size of $filename is to large for $_hostCode. ($fsize > $jira_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 jira_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}"
}
jira_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}] Uploading ${GREEN}${filename}${NC}"
tor_identity="${RANDOM}"
arrFiles=("$filepath")
trap "rm -f ${UploadTicket}; echo ""; tput cnorm; exit" 0 1 2 3 6 15
if ((jira_filetype == 1)) ; then
response=$(tor_curl_upload --insecure -i \
-H "Content-Type: multipart/form-data" \
-F "key=" \
-F "time=$jira_timeval" \
-F "file=@${filepath}" \
"${jira_PostUrlHost}")
else
response=$(tor_curl_upload --insecure -i \
-H "Content-Type: multipart/form-data" \
-F "key=" \
-F "time=$jira_timeval" \
-F "files[]=@${arrFiles[@]}" \
"${jira_PostUrlHost}")
fi
if [ "${DebugAllEnabled}" == "true" ] ; then
debugHtml "${filepath##*/}" "${_hostCode}_upload" "post_url: ${jira_PostUrlHost}"$'\n'"${response}"
fi
if grep -Eqi ' 200 ' <<< "${response}" ; then
hash=$(echo "$response" | tail -2 | head -1)
hash=${hash//[$'\t\r\n']}
filesize=$(GetFileSize "$filepath" "false")
downloadLink="${jira_downloadLinkPrefix}${hash}&p=1"
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 '(?<=HTTP/).*?(?=$)' <<< "$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
}
backupIFS=$IFS
IFS=$(echo -en "\n\b")
RED=$(tput setaf 1)