8.0 KiB
Usage Guide
Prerequisites
-
Install necessary software:
- Node.js
- Git
- Python
- Visual C++ Build Tools (Download link)
-
Obtain a You.com account and subscribe to Pro or Team plan, then log in.
-
Global proxy is recommended to ensure stable network connection.
-
If needed, you can set up a proxy in the
start.batfile.
Setup Steps
Method 1: Login using Cookie (Default)
Step 1: Obtain Cookie
-
Open browser and log in to you.com.
-
Press
F12to open developer tools, find the "Console" tab. -
Enter the following code in the console and press enter, then copy all output content (Cookie):
console.log(document.cookie);
Step 2: Configure Project
-
Download or clone this project code, unzip.
-
Edit
config.example.mjsfile, paste the Cookie obtained in the previous step.If there are multiple Cookies, add them in the following format, then save the file as
config.mjs:export const config = { "sessions": [ { "cookie": `cookie1` }, { "cookie": `cookie2` }, { "cookie": `cookie3` } ] }
Step 3: Configure Environment Variables
- Open
start.batfile, set environment variables as needed.
Step 4: Start Service
-
Double-click to run
start.bat. -
Wait for the program to install dependencies and start the service.
Step 5: Configure Client
-
In SillyTavern, select Custom (OpenAI-compatible).
-
Set the reverse proxy address to
http://127.0.0.1:8080/v1. -
Reverse proxy password needs to be filled (any value will do, unless
PASSWORDis set instart.bat). -
Start using. If it fails or there's no result, try multiple retries.
Method 2: Manual Login
Step 1: Configure start.bat
-
Open
start.batfile, setUSE_MANUAL_LOGINtotrue:set USE_MANUAL_LOGIN=true -
Save and close
start.batfile.
Step 2: Start Service and Manual Login
-
Double-click to run
start.bat. -
The program will start and automatically open a browser window.
-
Manually log in to your You.com account in the pop-up browser window.
-
After successful login, the program will automatically obtain the session information.
Step 3: Configure Client
Same as Step 5 in Method 1
Optional Configurations
Set Proxy
If you need to set a proxy, please set the http_proxy and https_proxy environment variables in start.bat. For example:
set http_proxy=http://127.0.0.1:7890
set https_proxy=http://127.0.0.1:7890
This project uses the local Chrome browser, which will automatically read and use the system proxy settings.
(If the browser crashes on startup, remove the proxy.)
Set AI Model
You can switch the model used by setting the AI_MODEL environment variable. Supported models include (please refer to the official website for the latest models):
gpt_4ogpt_4_turbogpt_4claude_3_5_sonnetclaude_3_opusclaude_3_sonnetclaude_3_haikuclaude_2llama3gemini_progemini_1_5_prodatabricks_dbrx_instructcommand_rcommand_r_pluszephyr
For example:
set AI_MODEL=claude_3_opus
Enable Custom Chat Mode
When enabled, it can shorten system message length, disable internet connection, reduce waiting time, which may help break through limitations.
set USE_CUSTOM_MODE=true
Enable Mode Rotation
Mode rotation will only be enabled when both USE_CUSTOM_MODE and ENABLE_MODE_ROTATION are set to true.
set ENABLE_MODE_ROTATION=true
Enable Tunnel Access
If you need to access the local service from the external network, you can enable tunnel access. Both ngrok and localtunnel are supported.
Using ngrok:
-
Set tunnel type:
set ENABLE_TUNNEL=true set TUNNEL_TYPE=ngrok -
Set ngrok Auth Token (obtain from ngrok dashboard):
set NGROK_AUTH_TOKEN=your_ngrok_auth_token -
(Optional) Set custom domain (paid account):
set NGROK_CUSTOM_DOMAIN=your_custom_domain
Using localtunnel:
-
Set tunnel type:
set ENABLE_TUNNEL=true set TUNNEL_TYPE=localtunnel -
(Optional) Set subdomain:
set SUBDOMAIN=your_subdomain
Important Notes
-
About Cloudflare CAPTCHA:
If a CAPTCHA prompt pops up during program operation, please complete the verification within 30 seconds.
-
About
ALLOW_NON_PROsetting:If set to
true, it allows the use of non-subscription accounts, but functionality will be limited and may not work properly.set ALLOW_NON_PRO=true -
About
CUSTOM_END_MARKERsetting:When the output cannot stop, you can set a custom termination marker. The program will automatically stop output after detecting this marker.
set CUSTOM_END_MARKER="<YOUR_END_MARKER>" -
About
ENABLE_DELAY_LOGICsetting:If requests are stuck, try setting this to
true.set ENABLE_DELAY_LOGIC=true -
About upload file format:
You can choose to upload files in
docxortxtformat.set UPLOAD_FILE_FORMAT=docx -
About 403 issue (mainly exists in old versions)
This issue mainly exists in old versions. The new version is less likely to be blocked as it uses browser simulation for access.
In the new version, if a CAPTCHA prompt pops up, users only need to complete the CloudFlare CAPTCHA within 30 seconds and wait for the program to continue processing.
Cloudflare has a risk control score. This is related to your TLS fingerprint, browser fingerprint, IP address reputation, etc. The TLS fingerprint and browser fingerprint used in this project have always been very suspicious (all are automation libraries and Node built-in TLS), directly maxing out the score. It's equivalent to having 30+30 points in advance, and the rest depends on how many points your IP address reputation takes (40 points) (The specific scores are not detailed, just an example) So if your IP is indeed white and takes 0 points, your total score is 60. Suppose You sets that scores higher than 80 require CAPTCHA, then there's no problem now. If your IP is black and takes more than 20 points, then you're >80 points, you need to do CAPTCHA, resulting in 403. Then recently You felt it was being abused too much, or for some other reason, set it so that scores above 60 require CAPTCHA. As a result, my IP is a bit black, and I can't get through no matter what. But with the same IP, if you access with normal Google Chrome, there's no problem, because its fingerprint is very clean, so the previous fingerprint score is very low. Even with the IP reputation score added, it doesn't reach that line. In short, the above is a simplified version, CF has many more indicators and strategies for anti-bot.
Deploy on Linux
You can deploy using Docker, please refer to the Dockerfile in the project.
FAQ
Q: How to solve the problem of npm failing to install dependencies?
A: Please ensure your network connection is stable, use global proxy if necessary.
Q: Why does the program prompt "Both modes have reached the request limit"?
A: This may be because frequent requests have caused the mode to be temporarily disabled. It is recommended to wait for a while before trying again.
Q: How to switch models?
A: Edit the AI_MODEL environment variable in start.bat, set it to the name of the model you want to use (can now be set in SillyTavern).
Disclaimer
This project is for learning and research purposes only. Please comply with relevant laws and regulations and do not use it for any commercial or illegal purposes.