diff --git a/index.js b/index.js index 5c831b1..4648bc4 100644 --- a/index.js +++ b/index.js @@ -6,8 +6,7 @@ const app = express(); const axios = require("axios"); const port = 8080; -axios.defaults.headers.common["User-Agent"] = - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"; +axios.defaults.headers.common["User-Agent"] = process.env.USER_AGENT; axios.defaults.headers.common["Cookie"] = process.env.YOUCOM_COOKIE; diff --git a/start.bat b/start.bat index be6a260..6bd87df 100644 --- a/start.bat +++ b/start.bat @@ -1,4 +1,5 @@ call npm install set YOUCOM_COOKIE=Your Cookie +set USER_AGENT=Your User-Agent node index pause \ No newline at end of file diff --git a/start.sh b/start.sh deleted file mode 100644 index bcdffa4..0000000 --- a/start.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -npm install -export YOUCOM_COOKIE="Your Cookie" -node index \ No newline at end of file diff --git a/usage.md b/usage.md index 17547fc..48c9bba 100644 --- a/usage.md +++ b/usage.md @@ -1,43 +1,47 @@ # 使用方法 -1. 获得一个 YOU.COM 账户并且订阅 +1. 获得一个 YOU.COM 账户并且订阅,登录。 -2. 打开 F12(DevTools)-Console(控制台)并且在 > 后面输入 `console.log(document.cookie)` 然后回车 +2. 打开 F12(DevTools),找到 “Network(网络)”、刷新一下页面,找到“you.com”这个项目 -3. 完整地复制输出结果 +3. 点进去,往下滑找到 "Cookie",完整的复制后面的内容。 -4. 下载或Clone本项目代码,解压 +4. 用同样的方法找到 "User-Agent",完整的复制后面的内容。 -5. 编辑 `start.bat` 文件,把上面的 Cookie 粘贴进去 +5. 下载或Clone本项目代码,解压 -6. 启动 start.bat +6. 编辑 `start.bat` 文件,把上面的 Cookie 和 User Agent 粘贴进去 -7. 酒馆中选择 Claude,反向代理地址填 http://127.0.0.1:8080/v1 +7. 启动 start.bat -8. 开始使用。如果失败了/没有结果/403/Warning 就多重试几次。 +8. 酒馆中选择 Claude,反向代理地址填 http://127.0.0.1:8080/v1 + +9. 开始使用。如果失败了/没有结果/403/Warning 就多重试几次。 ## 注意事项 -确保你访问 YOU.COM 的浏览器用的出口 IP 和你运行代理程序用的出口 IP 是同一个(简单的说就是要开 VPN 就全局开),否则你会被 CloudFlare 拦截并且获得一个 403 错误。 +出现 403 错误请重新抓 COOKIE 或者更换代理出口 IP。 # Usage -1. Get a YOU.COM account and subscribe. +1. Get a you.com account and subscribe, log in. -2. Open F12 (DevTools) - Console and enter `document.cookie`. +2. Open F12 (DevTools), find “Network”, refresh the page, and find “you.com”. -3. Copy the output result (excluding the leading and trailing ' characters). +3. Click on it, scroll down and find “Cookie:”, and copy the entire contents. -4. Download or clone the project code and extract it. +4. Find the "user-agnet" in the same way. -5. Edit the `start.bat` file and paste the Cookie from above into it. +5. Download or Clone the code of this project and unzip it. -6. Launch start.bat. +6. Edit the `start.bat` file and paste the cookie and User Agent into it. -7. In the ST, select Claude and fill in the reverse proxy address as http://127.0.0.1:8080/v1. +7. Start start.bat -8. Start using it. If it fails/no results/403/Warning, try again several times. +8. Select Claude in the Tavern and put http://127.0.0.1:8080/v1 as the address of the reverse proxy. -## Notes +9. Enjoy it. If it fails/no result/403/Warning, try again. -Ensure that the exit IP used by your browser when accessing YOU.COM and the exit IP used by your proxy program are the same (simply put, if you need to use a VPN, turn it on globally). Otherwise, you will be blocked by CloudFlare and get a 403 error. \ No newline at end of file +## Caution + +If you get 403 errors, consider getting the cookie again or changing your IP. \ No newline at end of file