Skip to content

Instantly share code, notes, and snippets.

@stets
Created October 4, 2023 02:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stets/b3a4761746562417439b061a3a71be31 to your computer and use it in GitHub Desktop.
Save stets/b3a4761746562417439b061a3a71be31 to your computer and use it in GitHub Desktop.
#!/bin/bash
API_URL='https://chat.openai.com/backend-api/settings/beta_features'
DISCORD_WEBHOOK_URL='REPLACE-ME-WITH-DISCORD-WEBHOOK'
function discord_alert() {
local msg=$1
local discord_url=${DISCORD_WEBHOOK}
local content="{ \"content\": \"$msg\" }"
curl -X POST -H "Content-Type: application/json" -d "$content" $DISCORD_WEBHOOK_URL
}
while true; do
RESPONSE=$(curl 'https://chat.openai.com/backend-api/settings/beta_features' \
-H 'authority: chat.openai.com' \
-H 'accept: */*' \
-H 'accept-language: en-US' \
-H 'authorization: Bearer <REPLACEME>' \
-H 'referer: https://chat.openai.com/?model=gpt-4' \
-H 'sec-ch-ua: "Chromium";v="116", "Not)A;Brand";v="24", "Google Chrome";v="116"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: same-origin' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36' \
--compressed)
echo $RESPONSE
if echo "$RESPONSE" | grep -q '"sunshine":true'; then
discord_alert "ChatGPT vision is enabled on your account!"
exit
else
sleep 10
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment