asmr-tg-backup proxy router extension
An optional, scope-aware network extension for
asmr-tg-backup. It supports
HTTP(S), SOCKS5/SOCKS5h endpoints and Clash-compatible subscription URLs via a
locally managed Mihomo process.
The core asks for a route for each operation. The selected proxy endpoint stays
fixed for the entire HTTP request, yt-dlp process, curl upload, or MTProto
connection. If an operation fails, a later retry can choose another static
endpoint; Mihomo's url-test group continuously selects a healthy subscription
node for new connections.
Install and enable
asmr-tg-backup extensions enable proxy-router
The trusted core command installs the extension into the current pipx/virtual
environment, asks only for the proxy source, endpoint, and routing preset,
writes a private config, validates the complete runtime, and safely restarts a
matching managed service. The defaults are local SOCKS5 at
127.0.0.1:7891 with proxy routing only for media probes and downloads.
For a container or another build-time-managed environment, install
asmr-tg-backup-ext-proxy-router==0.2.0 in the image and then run the same
enable command to create the private runtime configuration.
The following manual configuration remains available for advanced deployments.
Keep the plugin config outside the repository, for example
~/.config/asmr-tg-backup/proxy.toml, then reference it from the core config:
[extensions]
enabled = ["dreaife.proxy-router"]
[extensions."dreaife.proxy-router"]
required = true
config_file = "proxy.toml"
Run asmr-tg-backup extensions doctor before restarting the service.
Static SOCKS5 or HTTP proxy
fail_closed = true
routes = [
"http://127.0.0.1:7890",
"socks5h://127.0.0.1:7891",
]
[scopes]
"source.notification" = "proxy"
"media.probe" = "proxy"
"media.download" = "proxy"
"telegram.control.receive" = "direct"
"telegram.control.send" = "direct"
"telegram.delivery.bot_api" = "direct"
"telegram.delivery.mtproto" = "direct"
socks5h resolves destination host names through the proxy. A single endpoint
can also be written as:
[static]
socks5_host = "127.0.0.1"
socks5_port = 7891
Every scope defaults to direct; installing the package does not turn proxying
on implicitly. Each scope accepts direct, inherit, or proxy:
| Scope | Operation |
|---|---|
origin.resolve |
Resolve a user-facing source reference such as a YouTube handle |
source.notification |
Poll live/feed notifications |
source.discovery |
Enumerate source media and refresh source credentials |
media.probe |
One yt-dlp metadata probe process |
media.download |
One complete yt-dlp download/live-recording process |
telegram.control.receive |
Bot API getUpdates |
telegram.control.send |
Control-bot API responses |
telegram.delivery.bot_api |
Bot API media upload through curl |
telegram.delivery.mtproto |
One persistent Telethon connection |
With fail_closed = true, a proxy-scoped operation never silently falls back
to the direct network.
Clash-compatible subscription through Mihomo
Install a mihomo executable and keep the private HTTPS subscription URL in an
environment file:
export ASMR_PROXY_SUBSCRIPTION_URL='https://provider.example/private-token'
[mihomo]
enabled = true
binary = "mihomo"
subscription_url_env = "ASMR_PROXY_SUBSCRIPTION_URL"
listen_host = "127.0.0.1"
listen_port = 17891
refresh_seconds = 3600
health_check_seconds = 300
[scopes]
"media.probe" = "proxy"
"media.download" = "proxy"
The generated Mihomo configuration and log are stored with owner-only
permissions below the core data directory. The subscription URL is never
printed by this extension. Mihomo performs provider refresh, health checks, and
automatic url-test node selection.
Important boundaries
- The core never swaps the configured endpoint inside a running yt-dlp process. With a Mihomo subscription, an existing TCP connection remains on its node, while a newly opened fragment connection may use Mihomo's newly selected healthy node. A full core retry also obtains a new route lease.
- A Bot API upload never switches after sending begins, which preserves the delivery uncertainty boundary and avoids duplicate messages.
- MTProto routing is connection-scoped and changes only after reconnecting.
- If
telegram.bot_api.api_basepoints to a loopback Telegram Bot API daemon, the Python service always connects to that daemon directly. Proxy the daemon's own Telegram egress at the container, process, or network-namespace layer; this extension cannot alter another process's sockets. inheritpreserves legacy environment behavior for HTTP/curl/yt-dlp, but an explicitdirectorproxymode is easier to audit.
Compatibility
- Extension API level: 1
- Core:
asmr-tg-backup >=0.6,<0.7 - Python: 3.11 or newer
- Optional subscription backend: Mihomo
Licensed under Apache-2.0.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file asmr_tg_backup_ext_proxy_router-0.2.0.tar.gz.
File metadata
- Download URL: asmr_tg_backup_ext_proxy_router-0.2.0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e29d5f617725f2672d4570b61612e3721e4b4950c428b45684a271e50eca1339
|
|
| MD5 |
86381cfdd50061f10f076d43eddc254b
|
|
| BLAKE2b-256 |
5252e01b7e1fb0191f740b4855e7dba9ed995d8f9b2438f101cf82b5b4abe4b5
|
Provenance
The following attestation bundles were made for asmr_tg_backup_ext_proxy_router-0.2.0.tar.gz:
Publisher:
publish-pypi.yml on dreaifekks/asmr-tg-backup-ext-proxy-router
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
asmr_tg_backup_ext_proxy_router-0.2.0.tar.gz -
Subject digest:
e29d5f617725f2672d4570b61612e3721e4b4950c428b45684a271e50eca1339 - Sigstore transparency entry: 2411963626
- Sigstore integration time:
-
Permalink:
dreaifekks/asmr-tg-backup-ext-proxy-router@280bc5bd4d656ab88743a22cf0fe26e7683b873b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/dreaifekks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@280bc5bd4d656ab88743a22cf0fe26e7683b873b -
Trigger Event:
push
-
Statement type:
File details
Details for the file asmr_tg_backup_ext_proxy_router-0.2.0-py3-none-any.whl.
File metadata
- Download URL: asmr_tg_backup_ext_proxy_router-0.2.0-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfd510c795d35ec5232ad220f882b519b0421a4b6d7845d71ef639f1c8636ecc
|
|
| MD5 |
20c336b6a0a3919e9b0949bf6d235b31
|
|
| BLAKE2b-256 |
511f054c23ef1798acdb1733644e496af17e75b3e698bd8e3758da0ca380af3e
|
Provenance
The following attestation bundles were made for asmr_tg_backup_ext_proxy_router-0.2.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on dreaifekks/asmr-tg-backup-ext-proxy-router
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
asmr_tg_backup_ext_proxy_router-0.2.0-py3-none-any.whl -
Subject digest:
dfd510c795d35ec5232ad220f882b519b0421a4b6d7845d71ef639f1c8636ecc - Sigstore transparency entry: 2411963985
- Sigstore integration time:
-
Permalink:
dreaifekks/asmr-tg-backup-ext-proxy-router@280bc5bd4d656ab88743a22cf0fe26e7683b873b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/dreaifekks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@280bc5bd4d656ab88743a22cf0fe26e7683b873b -
Trigger Event:
push
-
Statement type: