Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git committed Sep 23, 2023
1 parent ebc5ea9 commit ed462c3
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions includes/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,6 @@ corrupted_file()
ui_error "The file '$1' is corrupted."
}

# 1 => URL; 2 => Referrer; 3 => Output
dl_generic()
{
"${WGET_CMD:?}" -q -O "${3:?}" -U "${DL_UA:?}" --header "${DL_ACCEPT_HEADER:?}" --header "${DL_ACCEPT_LANG_HEADER:?}" --header 'DNT: 1' --header "Referer: ${2:?}" --no-cache -- "${1:?}" || return "${?}"
}

_parse_webpage_and_get_url()
{
local _url _referrer _search_pattern
Expand Down Expand Up @@ -369,10 +363,12 @@ _direct_download()

dl_type_zero()
{
local _url

local _url _referrer _output
_url="${1:?}" || return "${?}"
dl_generic "${_url:?}" "${2:?}" "${3:?}" || return "${?}"
_referrer="${2?}" || return "${?}"
_output="${3:?}" || return "${?}"

_direct_download "${_url:?}" "${_referrer?}" "${_output:?}" || report_failure 0 "${?}" 'dl' || return "${?}"
}

report_failure_one()
Expand Down

0 comments on commit ed462c3

Please sign in to comment.