AUTORAY is a specialized VPN subscription manager and aggregator built with Python and Flask. It automates the process of scraping V2Ray, Xray, Trojan, and Shadowsocks configurations from Telegram channels, aggregates them, and serves them via managed subscription links.
- Automated Scraping: Uses
snscrapeto fetch fresh configurations from specified Telegram channels. - Protocol Support: Parses and cleans
vless,vmess,trojan, andss(Shadowsocks) links. - Subscription Management: Secure access via generated keys.
- Smart Caching: Background caching system to ensure low-latency responses and reduce scraping overhead.
- Discord Integration: Sends real-time notifications (new keys, errors, status updates) to a Discord Webhook.
- Multi-Port Support: Capable of running on multiple ports simultaneously using multiprocessing.
- Dynamic Renaming: Automatically renames configurations with timestamps or custom tags for better organization.
- Web Manager: A hosted web interface for easy management of keys and channels.
- Python 3.8+
pip(Python Package Installer)
-
Clone the repository (or download the source):
git clone <repository-url> cd AUTORAY
-
Install dependencies:
pip install flask discord.py snscrape pytz
Upon the first run, the application will generate a config.json file.
Default Configuration:
{
"api_secret": "ql1lGsB7TTO3TOOR2vRjaMgQi2DvmEWtngOkxNtFhTLQaDUne6sZvhRhD0jXUAKC0DtL9EW8fCZO5GdzHaIZyuBM2Re2OdYi",
"webhook_url": null,
"keys": [],
"channels": [
{
"name": "example_channel",
"scrape_mode": "time",
"scrape_days": 1
}
],
"ports": [2873],
"cache_ttl": 1800
}- api_secret: The master key for administrative API actions. Change this immediately for security.
- webhook_url: URL for Discord Webhook notifications.
- channels: List of Telegram channels to scrape.
- ports: Ports the server will listen on.
- cache_ttl: Time-to-live for cached configs in seconds (default: 30 minutes).
Start the server:
python handler.py-
Get Subscription:
GET /connect?key=<USER_KEY>Returns the subscription body containing all scraped configs. -
Partner/Custom Subscription:
GET /custom?key=<USER_KEY>&name=<CUSTOM_NAME>Returns configs renamed with the provided<CUSTOM_NAME>. -
Ping:
GET /pingReturnsALIVEstatus.
-
Create Key:
GET /createkey?secret=<API_SECRET>Generates a new user key and returns the subscription link. -
Add Channel:
GET /addchannel?secret=<API_SECRET>&name=<CHANNEL_ID>&mode=<MODE>&limit=<LIMIT>&days=<DAYS>Adds a Telegram channel to the scraper.name: Channel username (without @).mode:count(default) ortime.limit: Max messages to scan (used incountmode, default: 25).days: Number of days to look back (used intimemode).hours: Number of hours to look back (used intimemode).
-
Remove Channel:
GET /delchannel?secret=<API_SECRET>&name=<CHANNEL_ID> -
Set Webhook:
GET /setwebhook?secret=<API_SECRET>&url=<WEBHOOK_URL> -
Force Refresh:
GET /freshconnect?secret=<API_SECRET>Forces a cache update and returns fresh configs. -
List Channels:
GET /listchannels?secret=<API_SECRET>
This tool is for educational purposes only.