Skip to main content

subscription-2vless

A utility for downloading VPN subscriptions and extracting supported VPN configurations as links


CLI Usage

uvx subscription-2vless

The program will ask for the subscription URL:

Subscription URL: https://example.com/subscription
Fetching subscription...

Found 3 VPN URL(s):

  1. vless://...
  2. vmess://...
  3. trojan://...

Save all URLs to a file? [y/N]:

To save the discovered links, enter y or yes

Next, specify the output filename:

Output file [links.txt]:

Leave it empty to save the results to links.txt

Passing a subscription URL

You can pass the subscription URL directly as an argument:

uvx subscription-2vless "https://example.com/subscription"

Saving results to a file

Use -o or --output:

uvx subscription-2vless "https://example.com/subscription" -o links.txt

You can also specify an absolute path:

uvx subscription-2vless "https://example.com/subscription" --output /tmp/vpn-links.txt

Disabling file output

To display the discovered links in the console without saving them:

uvx subscription-2vless "https://example.com/subscription" --no-save

Overwriting an existing file

By default, the program asks for confirmation before overwriting an existing file

To allow overwriting automatically, use --force:

uvx subscription-2vless "https://example.com/subscription" -o links.txt --force

Help

Display all available arguments:

uvx subscription-2vless --help

Available arguments

Argument Description
url Subscription URL (optional)
-h, --help Display help information
-o, --output FILE Save results to the specified file
--no-save Do not offer to save the results
--force Overwrite an existing file without confirmation

Using as a Python Library

Retrieve links from a subscription:

from subscription_2vless import get_vpn_links_from_subscription

links = get_vpn_links_from_subscription(
    "https://example.com/subscription"
)

for link in links:
    print(link)

Determine the type of a link:

from subscription_2vless import parse_type_link

link = parse_type_link("vless://uuid@example.com:443")

print(type(link).__name__)  # Vless

Custom HTTP Headers

The following HTTP headers are used by default:

Header Default value
X-DEVICE-OS Android
X-VER-OS 14
X-HWID 6ba7b811-9dad-11d1-80b4-00c04fd430c8
User-Agent Incy/1.2.0 (Android; 14)

You can override them using SubscriptionHeaders:

from subscription_2vless import (
    SubscriptionHeaders,
    get_vpn_links_from_subscription,
)

headers = SubscriptionHeaders(
    X_DEVICE_OS="Android",
    X_VER_OS="14",
    HWID=None,  # Generate a random UUID
    user_agent="MyApplication/1.0",
)

links = get_vpn_links_from_subscription(
    "https://example.com/subscription",
    headers=headers,
)

Supported Protocols

Protocol URL schemes
VLESS vless://
VMess vmess://
Shadowsocks ss://
ShadowsocksR ssr://
Trojan trojan://
Hysteria hysteria://
Hysteria 2 hysteria2://, hy2://
TUIC tuic://
WireGuard wireguard://, wg://
SOCKS socks://, socks4://, socks5://
HTTP Proxy http://
HTTPS Proxy https://

License

MIT License

Metadata

Release files for subscription-2vless 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for subscription-2vless 1.1.1
File Size Uploaded Provenance Actions
subscription_2vless-1.1.1.tar.gz 7.7 kB Without provenance Details for subscription_2vless-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for subscription-2vless 1.1.1
File Interpreter ABI Platform Actions
subscription_2vless-1.1.1-py3-none-any.whl Python 3 none any Details for subscription_2vless-1.1.1-py3-none-any.whl

Total release size: 15.6 kB

Release files / subscription_2vless-1.1.1.tar.gz

Download URL subscription_2vless-1.1.1.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a11bddc4ccc66c37ce159b8382101ed03cbf859ed4be9fd65d98e13370d97639
BLAKE2b-256 checksum
How to use checksums
5af7cdac866ae8b930d3588431f45632d91250ef0f4c08bbf7f439a7fee55f5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.4

Release files / subscription_2vless-1.1.1-py3-none-any.whl

Download URL subscription_2vless-1.1.1-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac8178eff7295f2602b360018eb61c6657990e3680c101c137ed6f0864f88c30
BLAKE2b-256 checksum
How to use checksums
9348037e0c52723c113a636e6179dcf239dc35655caea9c2731df6871060656d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.4

Security for subscription-2vless 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page