Update unlock.sh

dependabot/github_actions/actions/checkout-3.1.0
fscarmen 4 years ago committed by GitHub
parent fe0c05183d
commit d559f6a227
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      unlock.sh

@ -238,6 +238,7 @@ sh -c "$TASK"
# 生成 warp_unlock.sh 文件,判断当前流媒体解锁状态,遇到不解锁时更换 WARP IP,直至刷成功。5分钟后还没有刷成功,将不会重复该进程而浪费系统资源
# 感谢以下两位作者: lmc999 [https://github.com/lmc999/RegionRestrictionCheck] 和 luoxue-bot [https://github.com/luoxue-bot/warp_auto_change_ip]
# 根据 lmc999 脚本检测 Netflix Title,如获取不到,使用兜底默认值
cat <<EOF >/etc/wireguard/warp_unlock.sh
#!/bin/bash
MODE="$CHOOSE1"
@ -283,7 +284,7 @@ check0(){
RESULT[0]=""; REGION[0]=""; R[0]="";
RESULT[0]=\$(curl --user-agent "\${UA_Browser}" \$NIC -fsL --write-out %{http_code} --output /dev/null --max-time 10 "https://www.netflix.com/title/\$RESULT_TITLE" 2>&1)
if [[ \${RESULT[0]} = 200 ]]; then
REGION[0]=\$(curl --user-agent "\${UA_Browser}" \$NIC -fs --max-time 10 --write-out %{red irect_url} --output /dev/null "https://www.netflix.com/title/\$REGION_TITLE" | sed 's/.*com\/\([^-/]\{1,\}\).*/\1/g' | tr '[:lower:]' '[:upper:]')
REGION[0]=\$(curl --user-agent "\${UA_Browser}" \$NIC -fs --max-time 10 --write-out %{redirect_url} --output /dev/null "https://www.netflix.com/title/\$REGION_TITLE" | sed 's/.*com\/\([^-/]\{1,\}\).*/\1/g' | tr '[:lower:]' '[:upper:]')
REGION[0]=\${REGION[0]:-'US'}
fi
echo "\${REGION[0]}" | grep -qi "\$EXPECT" && R[0]="\$UNLOCK_STATUS" || R[0]="\$NOT_UNLOCK_STATUS"

Loading…
Cancel
Save