mirror of
https://github.com/dockur/windows.git
synced 2026-05-06 14:41:24 +00:00
Replace curl-impersonate installation method
This commit is contained in:
parent
6ddd09259f
commit
58a970056f
1 changed files with 6 additions and 4 deletions
10
.github/workflows/links.yml
vendored
10
.github/workflows/links.yml
vendored
|
|
@ -28,13 +28,15 @@ jobs:
|
||||||
count=0
|
count=0
|
||||||
host=""
|
host=""
|
||||||
declare -A seen
|
declare -A seen
|
||||||
sudo apt-get update
|
wget https://github.com/lwthiker/curl-impersonate/releases/download/v0.6.1/curl-impersonate-v0.6.1.x86_64-linux-gnu.tar.gz
|
||||||
sudo apt-get install curl-impersonate
|
tar -xzf curl-impersonate-v0.6.1.x86_64-linux-gnu.tar.gz
|
||||||
|
sudo cp curl-impersonate-chrome /usr/local/bin/
|
||||||
|
curl-impersonate-chrome --version
|
||||||
check() {
|
check() {
|
||||||
local url="$1" http
|
local url="$1" http
|
||||||
http=$(curl_ff -sSL -o /dev/null -w "%{http_code}" --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0)" --max-time 10 -I -- "$url" 2>&1) || http="000"
|
http=$(curl-impersonate-chrome -sSL -o /dev/null -w "%{http_code}" --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0)" --max-time 10 -I -- "$url" 2>&1) || http="000"
|
||||||
[[ "$http" == 2* ]] && return 0
|
[[ "$http" == 2* ]] && return 0
|
||||||
http=$(curl_ff -sSL -o /dev/null -w "%{http_code}" --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0)" --max-time 10 -r "0-0" -- "$url" 2>&1) || http="000"
|
http=$(curl-impersonate-chrome -sSL -o /dev/null -w "%{http_code}" --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0)" --max-time 10 -r "0-0" -- "$url" 2>&1) || http="000"
|
||||||
printf '%s\n' "HTTP: $http"
|
printf '%s\n' "HTTP: $http"
|
||||||
[[ "$http" == 2* ]]
|
[[ "$http" == 2* ]]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue