|
|
|
|
@ -494,6 +494,7 @@ input_region(){ |
|
|
|
|
|
|
|
|
|
# 更换支持 Netflix WARP IP 改编自 [luoxue-bot] 的成熟作品,地址[https://github.com/luoxue-bot/warp_auto_change_ip] |
|
|
|
|
change_ip(){ |
|
|
|
|
|
|
|
|
|
change_wgcf(){ |
|
|
|
|
wgcf_restart(){ red " $(eval echo "${T[${L}126]}") " && ${SYSTEMCTL_RESTART[int]}; ss -nltp | grep dnsmasq >/dev/null 2>&1 && systemctl restart dnsmasq >/dev/null 2>&1; sleep $j; } |
|
|
|
|
unset T4 T6 |
|
|
|
|
@ -513,9 +514,9 @@ change_ip(){ |
|
|
|
|
ip${NF}_info |
|
|
|
|
WAN=$(eval echo \$WAN$NF) && ASNORG=$(eval echo \$ASNORG$NF) |
|
|
|
|
[[ $L = C ]] && COUNTRY=$(translate "$(eval echo \$COUNTRY$NF)") || COUNTRY=$(eval echo \$COUNTRY$NF) |
|
|
|
|
RESULT=$(curl --user-agent "${UA_Browser}" -$NF -fsL --write-out %{http_code} --output /dev/null --max-time 10 "https://www.netflix.com/title/81215567" 2>&1) |
|
|
|
|
RESULT=$(curl --user-agent "${UA_Browser}" -$NF -fsL --write-out %{http_code} --output /dev/null --max-time 10 "https://www.netflix.com/title/$RESULT_TITLE" 2>&1) |
|
|
|
|
if [[ $RESULT = 200 ]]; then |
|
|
|
|
REGION=$(tr '[:lower:]' '[:upper:]' <<< $(curl --user-agent "${UA_Browser}" -"$NF" -fs --max-time 10 --write-out %{redirect_url} --output /dev/null "https://www.netflix.com/title/80018499" | sed 's/.*com\/\([^-/]\{1,\}\).*/\1/g')) |
|
|
|
|
REGION=$(tr '[:lower:]' '[:upper:]' <<< $(curl --user-agent "${UA_Browser}" -"$NF" -fs --max-time 10 --write-out %{redirect_url} --output /dev/null "https://www.netflix.com/title/$REGION_TITLE" | sed 's/.*com\/\([^-/]\{1,\}\).*/\1/g')) |
|
|
|
|
REGION=${REGION:-'US'} |
|
|
|
|
echo "$REGION" | grep -qi "$EXPECT" && green " $(eval echo "${T[${L}125]}") " && i=0 && sleep 1h || wgcf_restart |
|
|
|
|
else wgcf_restart |
|
|
|
|
@ -535,9 +536,9 @@ change_socks5(){ |
|
|
|
|
ip_now=$(date +%s); RUNTIME=$((ip_now - ip_start)); DAY=$(( RUNTIME / 86400 )); HOUR=$(( (RUNTIME % 86400 ) / 3600 )); MIN=$(( (RUNTIME % 86400 % 3600) / 60 )); SEC=$(( RUNTIME % 86400 % 3600 % 60 )) |
|
|
|
|
proxy_info |
|
|
|
|
WAN=$PROXYIP && ASNORG=$PROXYASNORG && NF=4 && COUNTRY=$PROXYCOUNTRY |
|
|
|
|
RESULT=$(curl --user-agent "${UA_Browser}" -s4m7 --socks5 "$PROXYSOCKS5" -fsL --write-out %{http_code} --output /dev/null --max-time 10 "https://www.netflix.com/title/81215567" 2>&1) |
|
|
|
|
RESULT=$(curl --user-agent "${UA_Browser}" -s4m7 --socks5 "$PROXYSOCKS5" -fsL --write-out %{http_code} --output /dev/null --max-time 10 "https://www.netflix.com/title/$RESULT_TITLE" 2>&1) |
|
|
|
|
if [[ $RESULT = 200 ]]; then |
|
|
|
|
REGION=$(tr '[:lower:]' '[:upper:]' <<< $(curl --user-agent "${UA_Browser}" -s4m7 --socks5 "$PROXYSOCKS5" -fs --max-time 10 --write-out %{redirect_url} --output /dev/null "https://www.netflix.com/title/80018499" | sed 's/.*com\/\([^-/]\{1,\}\).*/\1/g')) |
|
|
|
|
REGION=$(tr '[:lower:]' '[:upper:]' <<< $(curl --user-agent "${UA_Browser}" -s4m7 --socks5 "$PROXYSOCKS5" -fs --max-time 10 --write-out %{redirect_url} --output /dev/null "https://www.netflix.com/title/$REGION_TITLE" | sed 's/.*com\/\([^-/]\{1,\}\).*/\1/g')) |
|
|
|
|
REGION=${REGION:-'US'} |
|
|
|
|
echo "$REGION" | grep -qi "$EXPECT" && green " $(eval echo "${T[${L}125]}") " && i=0 && sleep 1h || socks5_restart |
|
|
|
|
else socks5_restart |
|
|
|
|
@ -549,6 +550,10 @@ change_socks5(){ |
|
|
|
|
ip_start=$(date +%s) |
|
|
|
|
[[ $L = C ]] && timedatectl set-timezone Asia/Shanghai || timedatectl set-timezone UTC |
|
|
|
|
UA_Browser="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36" |
|
|
|
|
|
|
|
|
|
# 根据 lmc999 脚本检测 Netflix Title |
|
|
|
|
RESULT_TITLE=$(curl -sSL https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh | grep "result.*netflix.com/title/" | sed "s/.*title\/\([^\"]*\).*/\1/") |
|
|
|
|
REGION_TITLE=$(curl -sSL https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh | grep "region.*netflix.com/title/" | sed "s/.*title\/\([^\"]*\).*/\1/") |
|
|
|
|
|
|
|
|
|
# 判断刷 IP 时 WGCF 和 Client 的状态,分情况处理 |
|
|
|
|
WGCFSTATUS=0; SOCKS5STATUS=0 |
|
|
|
|
|