# 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)
41 lines
1.9 KiB
Bash
41 lines
1.9 KiB
Bash
#! Name: moocloud.sh
|
|
#! Author: kittykat
|
|
#! Version: 2024.11.26
|
|
#! Desc: Add support for downloading and processing of urls for a new host
|
|
#! Usage: Copy this file into the ./${ScriptDir}/hosts/ folder
|
|
#!
|
|
#!
|
|
#! ------------ REQUIRED SECTION ---------------
|
|
#! @[UPDATE] HostAndDomainRegexes: This string is loaded into mad.sh and allows dynamic handling of new url data
|
|
#! Format: '/HostCode/HostNick/HostFuncPrefix:HostDomainRegex@'
|
|
#! HostCode: <aUniqueCodeForHost> (ie. 'fh' for filehaus -- cannot be used by other hosts)
|
|
#! HostNick: What is displayed throughout MAD output (ie. 'filehaus' -- "urls.txt has 10 filehaus.." will be displayed)
|
|
#! HostFuncPrefix: <aUniqueStringThatMustPrefixHostFunctions> (ie. 'fh' -- fh_DownloadFile(), fh_FetchFileInfo() .. )
|
|
#! * Note: Must begin with a letter a-z (functions beginning with numbers are no bueno)
|
|
#! HostDomainRegex: The regex used to verify matching urls
|
|
HostCode='moo'
|
|
HostNick='moocloud.ch'
|
|
HostFuncPrefix='moo'
|
|
HostUrls='moocloud.ch'
|
|
HostDomainRegex='^(http|https)://(.*\.)?file\.tools\.moocloud\.ch/'
|
|
#!
|
|
#! !! DO NOT UPDATE OR REMOVE !!
|
|
#! This merges the Required HostAndDomainRegexes into mad.sh
|
|
ListHostAndDomainRegexes=${ListHostAndDomainRegexes}'/'${HostCode}'/'${HostNick}'/'${HostFuncPrefix}'/'${HostUrls}':'${HostDomainRegex}'@'
|
|
#!
|
|
#!
|
|
#! ------------ (1) Host Main Download Function --------------- #
|
|
#!
|
|
#! This is a direct= download host, so all the functions are already in mad.sh
|
|
#! Since the HostFuncPrefix is defined above as "direct", nothing further needs to be done as it will
|
|
#! call the direct_DownloadFile() function already in mad.sh
|
|
moo_DownloadFile() {
|
|
local pUrl="$1"
|
|
local pFileCnt="$2"
|
|
local pFileUrl="$pUrl"
|
|
if ! grep -Eqi '&p=1$' <<< "$pUrl" ; then
|
|
pFileUrl="${pUrl}&p=1"
|
|
echo -e "[${BLUE}ModifiedUrl${NC}]: ${pFileUrl}"
|
|
fi
|
|
direct_DownloadFile "$pUrl" "$pFileCnt" "$pFileUrl"
|
|
}
|