2021-06-01 21:14:03 +02:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
url="$(url_decode "$(url_decode "$(sed -E 's/\?/<2F><>Lun4_iS_CuTe<54>/;s/^(.*)<29><>Lun4_iS_CuTe<54>//;s/'"${cfg[proxy_param]}"'=//g' <<< "${r[url]}")")")"
|
2020-07-24 14:50:08 +02:00
|
|
|
|
|
2021-06-01 21:14:03 +02:00
|
|
|
|
if [[ $(grep -Poh "${cfg[proxy_url]}" <<< "$url") == '' ]]; then
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
host="$(sed -E 's@http(s|)://@@;s@/.*@@' <<< "$url")"
|
2021-06-01 23:48:02 +02:00
|
|
|
|
proxy_url="$(sed -E 's/\?.*//g' <<< "${r[url]}")"
|
2021-06-01 21:14:03 +02:00
|
|
|
|
headers="$(tr '\r' '\n' <<< "${r[req_headers]}")"
|
|
|
|
|
headers+=$'\n'
|
|
|
|
|
|
|
|
|
|
while read line; do
|
2021-06-01 22:06:25 +02:00
|
|
|
|
if [[ "$line" != "GET"* && "$line" != "Host:"* && "$line" != '' ]]; then
|
|
|
|
|
params+="-H '$line' "
|
2021-06-01 21:14:03 +02:00
|
|
|
|
fi
|
2021-06-01 22:06:25 +02:00
|
|
|
|
done <<< "$headers"
|
|
|
|
|
|
2021-06-01 23:48:02 +02:00
|
|
|
|
curl -v --http1.1 "$url" "$params" -D /dev/stdout | grep -aiv "Transfer-Encoding: chunked" | sed -E 's@Location: @Location: '"$proxy_url"'?'"${cfg[proxy_param]}"'=@'
|