English | 简体中文
Easy way to generate your own V2Ray subscription link.
Many free V2Ray server providers do not provide subscription link, so you have to manually copy the server link every
time it is updated. Unfortunately, these updates can sometimes be very frequent, which can be annoying.
This project can help you generate a subscription link to get rid of this problem.
The workflow configuration file is .github/workflows/generate.yml
.
Replace YOUR_URL_HERE
with your desired URL, which is the website that contains free V2Ray server links:
- name: Run generate.py
run: python generate.py --url YOUR_URL_HERE
Check the workflow job status and details in your project's Actions
section. You can also manually trigger the job
here.
By default, it runs automatically every 2 hours. To change the frequency, edit the cron
schedule in the configuration
file:
on:
schedule:
- cron: '0 */2 * * *' # For example, changing 2 to 12 means running the workflow job every 12 hours.
The schedule uses cron syntax, see cron expression for details.
Use the link of the links.txt
file as your Subscription Link. It will look like:
https://raw.githubusercontent.com/{YOUR_USERNAME}/{YOUR_PROJECT_NAME}/main/links.txt
Requirements:
- python >= 3.11
- requests >= 2.32.3
- beautifulsoup4 >= 4.12.3
Run the script with your own URL:
python generate.py --url YOUR_URL_HERE
This will output a file named links.txt
in the root directory.
For more information, use -h
:
python generate.py -h
Use any tool, such as Nginx, to serve the links.txt
file from your server. Use this URL as your subscription
link.
This project uses simple regex (you can also add your own) to match links with the protocol
prefixes vmess://
, vless://
and ss://
from a specific website.
Once the links are extracted, they are written into the links.txt
file in the format specified
by 2dust/v2rayN, which
states:
- All links are joined into a string with delimiter
\n
, then encoded intoBase64
.
The URL of the links.txt
file can then be used as a subscription link for V2Ray clients.