Skip to content
This repository has been archived by the owner on Jun 23, 2024. It is now read-only.

Commit

Permalink
fix: possible misjudgments
Browse files Browse the repository at this point in the history
  • Loading branch information
missuo committed Feb 11, 2023
1 parent 2451d8c commit 1afd6ed
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions openai.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# @Author: Vincent Young
# @Date: 2023-02-09 17:39:59
# @LastEditors: Vincent Young
# @LastEditTime: 2023-02-09 23:03:26
# @LastEditTime: 2023-02-11 09:13:49
# @FilePath: /OpenAI-Checker/openai.sh
# @Telegram: https://t.me/missuo
#
Expand All @@ -29,7 +29,8 @@ else
if [[ "$check4" != *"received"* ]] && [[ "$check4" != *"transmitted"* ]];then
echo -e "\033[34mIPv4 is not supported on the current host. Skip...\033[0m";
else
local_ipv4=$(curl -4 -s --max-time 10 api64.ipify.org)
# local_ipv4=$(curl -4 -s --max-time 10 api64.ipify.org)
local_ipv4=$(curl -4 -sS https://chat.openai.com/cdn-cgi/trace | grep "ip=" | awk -F= '{print $2}')
local_isp4=$(curl -s -4 --max-time 10 --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36" "https://api.ip.sb/geoip/${local_ipv4}" | grep organization | cut -f4 -d '"')
#local_asn4=$(curl -s -4 --max-time 10 --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36" "https://api.ip.sb/geoip/${local_ipv4}" | grep asn | cut -f8 -d ',' | cut -f2 -d ':')
echo -e "${BLUE}Your IPv4: ${local_ipv4} - ${local_isp4}${PLAIN}"
Expand All @@ -47,7 +48,8 @@ else
if [[ "$check6" != *"received"* ]] && [[ "$check6" != *"transmitted"* ]];then
echo -e "\033[34mIPv6 is not supported on the current host. Skip...\033[0m";
else
local_ipv6=$(curl -6 -s --max-time 20 api64.ipify.org)
# local_ipv6=$(curl -6 -s --max-time 20 api64.ipify.org)
local_ipv6=$(curl -6 -sS https://chat.openai.com/cdn-cgi/trace | grep "ip=" | awk -F= '{print $2}')
local_isp6=$(curl -s -6 --max-time 10 --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36" "https://api.ip.sb/geoip/${local_ipv6}" | grep organization | cut -f4 -d '"')
#local_asn6=$(curl -s -6 --max-time 10 --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36" "https://api.ip.sb/geoip/${local_ipv6}" | grep asn | cut -f8 -d ',' | cut -f2 -d ':')
echo -e "${BLUE}Your IPv6: ${local_ipv6} - ${local_isp6}${PLAIN}"
Expand Down

0 comments on commit 1afd6ed

Please sign in to comment.