mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-24 09:55:12 +00:00
docs: apply simplified technical english across docs and docstrings.
This commit is contained in:
+126
-123
@@ -1,28 +1,28 @@
|
||||
# Proxies & VPN
|
||||
|
||||
Most streaming services are geo-restricted, region-priced, or simply refuse to hand
|
||||
Most streaming services are geo-restricted, region-priced, or refuse to hand
|
||||
over a manifest from the "wrong" country. unshackle routes its traffic through a proxy
|
||||
so the service sees the location you choose instead of your own. You can point it at a
|
||||
single proxy URL, or configure one of several **proxy providers** (commercial VPNs and
|
||||
self-hosted tunnels), then ask for a country by its two-letter code and let
|
||||
unshackle pick a working server for you.
|
||||
|
||||
The `--proxy` flag controls proxying, and a query is resolved to a real proxy URL by the
|
||||
providers unshackle supports: [basic static proxies](#basic-static-proxies),
|
||||
The `--proxy` flag controls proxying, and the proxy providers unshackle supports change
|
||||
a query to a real proxy URL: [basic static proxies](#basic-static-proxies),
|
||||
[Gluetun](#gluetun) (documented in the most detail, since it is the most flexible),
|
||||
[ExpressVPN](#expressvpn), [NordVPN](#nordvpn), [Proton VPN](#proton-vpn),
|
||||
[Hola](#hola), [Surfshark](#surfshark), and [Windscribe](#windscribe).
|
||||
|
||||
!!! note "Where proxies are configured"
|
||||
All provider configuration lives under the top-level `proxy_providers:` key in your
|
||||
`unshackle.yaml`. Each provider has its own sub-key, and the keys inside it map
|
||||
directly onto that provider's settings. See the
|
||||
All proxy provider configuration lives under the top-level `proxy_providers:`
|
||||
config key in your `unshackle.yaml`. Each proxy provider has its own sub-key, and
|
||||
the config keys inside it map directly onto that proxy provider's settings. See the
|
||||
[Configuration file](../getting-started/configuration-file.md) page for where the
|
||||
file lives and how it is loaded.
|
||||
file lives and how unshackle loads it.
|
||||
|
||||
## The `--proxy` flag
|
||||
|
||||
Proxying is controlled at download time by three options on the `dl` command:
|
||||
Three options on the `dl` command control proxying at download time:
|
||||
|
||||
| Option | Effect |
|
||||
|---|---|
|
||||
@@ -43,14 +43,14 @@ unshackle dl --proxy nordvpn:us EXAMPLE 81234567
|
||||
```
|
||||
|
||||
!!! tip "Set a default proxy in config"
|
||||
Like every `dl` flag, `--proxy` can be given a default in your configuration so you
|
||||
Like every `dl` flag, you can give `--proxy` a default in your configuration, so you
|
||||
do not have to pass it on every command. See
|
||||
[Downloading](downloading.md) for how `dl` options and config defaults interact.
|
||||
|
||||
### `--no-proxy-download`
|
||||
|
||||
Segment downloads are usually the largest share of traffic, and a residential-grade VPN
|
||||
proxy is often the slowest link in the chain. `--no-proxy-download` lets you keep the
|
||||
proxy is frequently the slowest part of the chain. `--no-proxy-download` lets you keep the
|
||||
proxy where it matters (passing the geo-check for the manifest and the licence) while
|
||||
pulling the files themselves over your normal connection at full speed.
|
||||
|
||||
@@ -66,8 +66,8 @@ unshackle dl --proxy gb --no-proxy-download EXAMPLE 10a1234
|
||||
|
||||
## How proxy resolution works
|
||||
|
||||
The value you pass to `--proxy` is interpreted in one of three ways. unshackle checks
|
||||
them in order.
|
||||
unshackle interprets the value you pass to `--proxy` in one of three ways. It tries
|
||||
them in this order.
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
@@ -78,54 +78,56 @@ flowchart TD
|
||||
D -- no --> F["Ask every provider in order,<br/>first match wins"]
|
||||
```
|
||||
|
||||
1. **An explicit URI.** Anything shaped like `http://...`, `https://...`, or a `socks...`
|
||||
URI is used exactly as given. unshackle logs `Using explicit Proxy: ...` and does no
|
||||
lookup.
|
||||
1. **An explicit URI.** unshackle uses anything shaped like `http://...`,
|
||||
`https://...`, or a `socks...` URI exactly as you give it. unshackle logs
|
||||
`Using explicit Proxy: ...` and does no lookup.
|
||||
2. **A provider-prefixed query**: `provider:query`, for example `nordvpn:us` or
|
||||
`gluetun:windscribe:us`. unshackle finds the provider whose name matches the prefix
|
||||
(case-insensitive) and asks *only* that provider to resolve the remainder. If no such
|
||||
provider is loaded, or it returns no proxy, the download errors.
|
||||
`gluetun:windscribe:us`. unshackle finds the proxy provider whose name matches
|
||||
the prefix (case-insensitive). It then asks *only* that proxy provider to find a
|
||||
proxy for the remainder. If unshackle loads no such proxy provider, or if that
|
||||
proxy provider returns no proxy, the download errors.
|
||||
3. **A bare query**: a region like `us`, `gb`, `us:seattle`, or `us1234`. unshackle
|
||||
asks each loaded provider **in order** and uses the first proxy any of them returns.
|
||||
asks each loaded proxy provider **in order** and uses the first proxy any of them
|
||||
returns.
|
||||
|
||||
The query is matched against a region grammar (a two-letter country code, optionally
|
||||
followed by a server number and/or a `:city` or `-city` part), lowercased, and then
|
||||
handed to the provider. The exact forms each provider accepts are documented in its
|
||||
section below.
|
||||
unshackle compares the query against a region grammar: a two-letter country code,
|
||||
optionally followed by a server number and/or a `:city` or `-city` part. It then
|
||||
lowercases the query and hands it to the proxy provider. Its section below gives the
|
||||
exact forms each proxy provider accepts.
|
||||
|
||||
### Provider load order
|
||||
|
||||
When you run a download without `--no-proxy`, unshackle instantiates every configured
|
||||
provider once, in this fixed order, and that same order is used for bare-query
|
||||
When you do a download without `--no-proxy`, unshackle instantiates every configured
|
||||
proxy provider once, in this fixed order. It uses that same order for bare-query
|
||||
resolution:
|
||||
|
||||
**Basic → ExpressVPN → NordVPN → Proton VPN → Surfshark → Windscribe → Gluetun → Hola**
|
||||
|
||||
So if you have both Basic and NordVPN configured and run `--proxy us`, a `us` entry in
|
||||
your Basic config wins because Basic is tried first. To skip ahead to a specific
|
||||
provider, prefix the query (`--proxy nordvpn:us`).
|
||||
So if you have both Basic and NordVPN configured and use `--proxy us`, a `us` entry in
|
||||
your Basic config wins, because unshackle tries Basic first. To skip ahead to a specific
|
||||
proxy provider, prefix the query (`--proxy nordvpn:us`).
|
||||
|
||||
!!! note "Auto-loading providers"
|
||||
Most providers only load when you configure them under `proxy_providers:`. Three are
|
||||
special: **ExpressVPN** and **Proton VPN** also load automatically once their cached
|
||||
session file exists on disk (even with no YAML), and **Hola** loads automatically
|
||||
special: **ExpressVPN** and **Proton VPN** also load automatically once their cache
|
||||
file exists on disk (even with no YAML), and **Hola** loads automatically
|
||||
whenever the `hola-proxy` binary is found on your `PATH`.
|
||||
|
||||
### Connection feedback
|
||||
|
||||
After a provider resolves a query, unshackle prints a line so you can confirm
|
||||
After a proxy provider resolves a query, unshackle prints a line so you can see
|
||||
where you came out:
|
||||
|
||||
- **Gluetun** reports the verified exit IP, country, and city of the container.
|
||||
- **ExpressVPN** and **Proton VPN** print a location summary such as
|
||||
`(USA - New York, #3 of 5): .214`.
|
||||
- Other providers log the resolved proxy URL.
|
||||
- Other proxy providers log the resolved proxy URL.
|
||||
|
||||
## Basic (static proxies)
|
||||
|
||||
The `Basic` provider is pure static configuration, with no accounts and no network calls. You
|
||||
list proxy URLs per country code, and unshackle serves them back when you query that
|
||||
country. This is the right choice when you already have proxy endpoints (from a proxy
|
||||
The `Basic` proxy provider is pure static configuration, with no accounts and no network
|
||||
calls. You record proxy URLs under each country code, and unshackle serves them back
|
||||
when you query that country. This is the right choice when you already have proxy endpoints (from a proxy
|
||||
seller, your own servers, or a corporate gateway).
|
||||
|
||||
Under each two-letter country code you can put either a single proxy string or a list of
|
||||
@@ -148,10 +150,10 @@ proxy_providers:
|
||||
| `us2` | The **2nd** entry in the US list (1-based). |
|
||||
|
||||
- If a country has a single proxy string, that proxy is always returned.
|
||||
- If it has a list and you give a plain country code, one is picked at random; append an
|
||||
index (`de1`, `de2`) to pin a specific entry.
|
||||
- Each URL is normalised (a missing scheme defaults to `http`) and validated, so a
|
||||
malformed URI is rejected up front rather than failing mid-download.
|
||||
- If it has a list and you give a plain country code, unshackle picks one at random.
|
||||
Append an index (`de1`, `de2`) to pin a specific entry.
|
||||
- unshackle normalises each URL (a missing scheme defaults to `http`) and validates it,
|
||||
so it rejects a malformed URI up front and does not fail mid-download.
|
||||
|
||||
```shell
|
||||
unshackle dl --proxy de2 EXAMPLE 81234567
|
||||
@@ -173,13 +175,13 @@ in unshackle itself.
|
||||
|
||||
!!! warning "Docker is required"
|
||||
Gluetun needs a working [Docker](https://docs.docker.com/get-docker/) installation on
|
||||
your `PATH`. If Docker is not found, the provider fails to load with an error linking
|
||||
your `PATH`. If Docker is not found, the proxy provider fails to load with an error linking
|
||||
to the install docs. The container also needs the `NET_ADMIN` capability and access
|
||||
to `/dev/net/tun` to bring up the tunnel. unshackle requests both automatically.
|
||||
|
||||
### Query format
|
||||
|
||||
Gluetun uses a nested selector: the provider prefix picks Gluetun, and the rest names the
|
||||
Gluetun uses a nested selector: the proxy provider prefix picks Gluetun, and the rest names the
|
||||
**VPN provider** and the **region**.
|
||||
|
||||
```
|
||||
@@ -194,10 +196,10 @@ unshackle dl --proxy gluetun:windscribe:us EXAMPLE 81234567
|
||||
unshackle dl --proxy gluetun:nordvpn:de EXAMPLE 81234567
|
||||
```
|
||||
|
||||
After unshackle strips the leading `gluetun:`, the provider receives exactly
|
||||
`provider:region` (two colon-separated parts; anything else is an error). The
|
||||
`<vpn-provider>` must be one you have configured under `gluetun.providers`, and friendly
|
||||
names are normalised to Gluetun's identifiers (for example `pia` and
|
||||
After unshackle strips the leading `gluetun:`, the proxy provider receives exactly
|
||||
`provider:region`. It must be two colon-separated parts, and anything else is an error.
|
||||
The `<vpn-provider>` must be one you have configured under `gluetun.providers`, and
|
||||
unshackle normalises friendly names to Gluetun's identifiers (for example `pia` and
|
||||
`privateinternetaccess` both map to `private internet access`).
|
||||
|
||||
### Configuration
|
||||
@@ -256,7 +258,7 @@ proxy_providers:
|
||||
- `private_key` is **always** required.
|
||||
- `surfshark`, `mullvad`, and `ivpn` also require `addresses`.
|
||||
- `windscribe` additionally requires **both** `addresses` and `preshared_key`
|
||||
(`preshared_key` may be an empty string, but the key must be present).
|
||||
(`preshared_key` may be an empty string, but the config key must be present).
|
||||
- NordVPN and Proton VPN need only `private_key`.
|
||||
|
||||
=== "OpenVPN"
|
||||
@@ -266,10 +268,10 @@ proxy_providers:
|
||||
!!! tip "Which `vpn_type` should I pick?"
|
||||
WireGuard is the default because it **can be faster**, but it needs the fiddlier
|
||||
credential setup above (private keys, and for some providers `addresses` and a
|
||||
preshared key). OpenVPN is the **simplest** to configure (just a username and
|
||||
password) at the cost of some speed. If you are getting started or hitting credential
|
||||
trouble, OpenVPN is the path of least resistance; switch to WireGuard when you want the
|
||||
extra throughput.
|
||||
`preshared_key`). OpenVPN is the **simplest** to configure (only a username and
|
||||
password) at the cost of some speed. If you start out, or if you have credential
|
||||
trouble, OpenVPN is the path of least resistance. Switch to WireGuard when you want
|
||||
the extra throughput.
|
||||
|
||||
**Global keys:**
|
||||
|
||||
@@ -287,37 +289,38 @@ For a given query region, Gluetun resolves the server like this:
|
||||
|
||||
1. An explicit entry in `server_hostnames`, `server_cities`, or `server_countries` for
|
||||
that alias always wins.
|
||||
2. A `us1239`-style query (country code + number) with no explicit mapping is turned
|
||||
into a provider-specific server hostname (for example `us1239.nordvpn.com` for
|
||||
NordVPN, `us-1239.prod.surfshark.com` for Surfshark).
|
||||
3. A bare two-letter code is expanded to the full country name Gluetun expects.
|
||||
2. unshackle changes a `us1239`-style query (country code + number) with no explicit
|
||||
mapping into a provider-specific server hostname (for example `us1239.nordvpn.com`
|
||||
for NordVPN, `us-1239.prod.surfshark.com` for Surfshark).
|
||||
3. unshackle expands a bare two-letter code to the full country name Gluetun expects.
|
||||
|
||||
A few providers (Windscribe, VyprVPN, VPN Secure) select by **region** rather than
|
||||
country, and Windscribe region names are translated automatically. For instance `us`
|
||||
country, and unshackle converts Windscribe region names automatically. For instance `us`
|
||||
becomes `US East` and `uk`/`gb` become `United Kingdom`.
|
||||
|
||||
### Container lifecycle
|
||||
|
||||
Understanding what Gluetun does behind the scenes helps when something goes wrong:
|
||||
|
||||
1. **Image check.** `qmcgaw/gluetun:latest` is pulled if it is not already present.
|
||||
2. **Reuse.** If a container for this exact `provider:region` is already running (from a
|
||||
concurrent unshackle session), it is adopted instead of starting a new one. Stopped or
|
||||
dead containers with the same name are pruned first.
|
||||
1. **Image check.** unshackle pulls `qmcgaw/gluetun:latest` if it is not already
|
||||
present.
|
||||
2. **Reuse.** If a container for this exact `provider:region` already runs (from a
|
||||
concurrent unshackle process), unshackle adopts it and does not start a new one. It
|
||||
removes stopped or dead containers with the same name first.
|
||||
|
||||
!!! note "Expect a slow first request, then instant reuse"
|
||||
Bringing up a fresh tunnel takes roughly **10 to 30 seconds** for the first request to a
|
||||
given `provider:region`. This is the VPN handshake and readiness wait, not a hang.
|
||||
Every subsequent request that reuses that same container is effectively **instant**. A
|
||||
slow first run is normal.
|
||||
3. **Port allocation.** A free local port is chosen starting from `base_port`.
|
||||
4. **Start.** The container is launched bound to `127.0.0.1:{port}`. Credentials are
|
||||
passed through a temporary, `0600`-permission env-file (never as `-e` flags), which is
|
||||
overwritten and deleted immediately after.
|
||||
5. **Readiness wait.** unshackle polls the container logs (up to 60 seconds) until both
|
||||
the HTTP proxy is listening **and** the VPN reports a completed connection. Fatal
|
||||
errors like `authentication failed` or `invalid credentials` abort early, and recent
|
||||
logs are attached to the error to help you diagnose it.
|
||||
3. **Port allocation.** unshackle chooses a free local port, starting from `base_port`.
|
||||
4. **Start.** unshackle launches the container bound to `127.0.0.1:{port}`. It passes
|
||||
credentials through a temporary, `0600`-permission env-file (never as `-e` flags),
|
||||
and it overwrites and deletes that file immediately after.
|
||||
5. **Readiness wait.** unshackle polls the container logs (up to 60 seconds) until the
|
||||
HTTP proxy listens **and** the VPN reports a completed connection. Fatal errors like
|
||||
`authentication failed` or `invalid credentials` abort early, and unshackle attaches
|
||||
recent logs to the error to help you diagnose it.
|
||||
6. **IP verification.** When `verify_ip` is on, unshackle queries the container's exit IP
|
||||
and checks the country matches what you asked for, raising a *region mismatch* error if
|
||||
it does not.
|
||||
@@ -325,23 +328,23 @@ Understanding what Gluetun does behind the scenes helps when something goes wron
|
||||
configured).
|
||||
|
||||
!!! note "Cleanup and Ctrl+C"
|
||||
Containers are cleaned up via an `atexit` handler on normal exit. Gluetun deliberately
|
||||
does **not** install its own signal handlers, so `Ctrl+C` continues to work as you
|
||||
expect. If a run is killed hard (e.g. `kill -9`) a container can be left behind; with
|
||||
`auto_cleanup: true` the next run adopting that name will still work, or you can remove
|
||||
it manually with `docker rm -f`.
|
||||
unshackle cleans up containers with an `atexit` handler on normal exit. Gluetun
|
||||
deliberately does **not** install its own signal handlers, so `Ctrl+C` continues to
|
||||
work as you expect. If something kills a run hard (for example `kill -9`), a container
|
||||
can stay behind. With `auto_cleanup: true` the next run that adopts that name still
|
||||
works, or you can remove it manually with `docker rm -f`.
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
!!! example "Common Gluetun issues"
|
||||
- **`RuntimeError` about Docker not found.** Install Docker and confirm `docker` is
|
||||
on your `PATH`.
|
||||
- **`RuntimeError` about Docker not found.** Install Docker and make sure that
|
||||
`docker` is on your `PATH`.
|
||||
- **`invalid credentials` / `authentication failed` in the readiness wait.** Your
|
||||
WireGuard/OpenVPN credentials are wrong or in the wrong fields. Double-check
|
||||
`private_key`, `addresses`, and (for Windscribe) `preshared_key`.
|
||||
- **Region mismatch error.** The VPN connected but exited in a different country than
|
||||
requested. Check your `server_countries` mapping, or set `verify_ip: false` if you
|
||||
are intentionally using a nearby region.
|
||||
requested. Examine your `server_countries` mapping, or set `verify_ip: false` if
|
||||
you intentionally use a nearby region.
|
||||
- **Timeout after 60 seconds.** The tunnel never came up. Inspect the container logs
|
||||
(`docker logs <container>`) for the underlying VPN error.
|
||||
|
||||
@@ -349,10 +352,10 @@ Understanding what Gluetun does behind the scenes helps when something goes wron
|
||||
|
||||
ExpressVPN mirrors the ExpressVPN Android TV app: it signs in through Express's OAuth 2.0
|
||||
device-login flow, obtains proxy-capable locations from Express's API, and returns an
|
||||
authenticated HTTPS proxy. The device login runs once; after that the cached refresh token
|
||||
keeps the session alive headlessly.
|
||||
authenticated HTTPS proxy. The device login runs once. After that, the cached refresh
|
||||
token keeps you signed in headlessly.
|
||||
|
||||
Enable it and run a download interactively once:
|
||||
Enable it and do a download interactively once:
|
||||
|
||||
```yaml title="unshackle.yaml"
|
||||
proxy_providers:
|
||||
@@ -361,8 +364,8 @@ proxy_providers:
|
||||
```
|
||||
|
||||
With `enable: true` and an interactive terminal, unshackle prints a code and a URL to
|
||||
enter it at. Once approved, the tokens are cached and reused automatically, so later runs
|
||||
need no terminal. ExpressVPN also **auto-loads** once its token cache exists, so you can
|
||||
enter it at. Once you approve it, unshackle caches the tokens and reuses them
|
||||
automatically, so later runs need no terminal. ExpressVPN also **auto-loads** once its token cache exists, so you can
|
||||
drop `enable` after the first login, but you can keep a YAML block to pin regions or
|
||||
servers:
|
||||
|
||||
@@ -398,14 +401,14 @@ The resolved proxy is an HTTPS proxy on port `443`. On success, unshackle prints
|
||||
location summary such as `(USA - New York, #3 of 5): .214`.
|
||||
|
||||
!!! note "Cache safety"
|
||||
ExpressVPN's token cache is written with `0600` permissions so the refresh token is
|
||||
never briefly world-readable.
|
||||
unshackle writes ExpressVPN's token cache with `0600` permissions, so the refresh
|
||||
token is never briefly world-readable.
|
||||
|
||||
## NordVPN
|
||||
|
||||
NordVPN uses your **Service Credentials**, not your normal NordVPN login. Generate them
|
||||
NordVPN uses your **Service Credentials**, not your normal NordVPN login. Make them
|
||||
from the [NordVPN dashboard](https://my.nordaccount.com/dashboard/nordvpn/) under manual
|
||||
setup; they are a long random username/password pair, not your email and password.
|
||||
setup. They are a long random username/password pair, not your email and password.
|
||||
|
||||
```yaml title="unshackle.yaml"
|
||||
proxy_providers:
|
||||
@@ -423,9 +426,9 @@ the username must not contain an `@`. If validation fails, you have almost certa
|
||||
your login credentials instead of your service credentials.
|
||||
|
||||
`server_map` is optional and maps a region (or `code:city`) to a pinned NordVPN server ID.
|
||||
Its main use is tuning: for a given streaming service one specific server often performs
|
||||
noticeably better than NordVPN's recommended pick, so hard-coding that server for a day or
|
||||
two is a handy workaround until it degrades and you swap in another.
|
||||
Its main use is to tune performance: for a given streaming service one specific server
|
||||
often performs noticeably better than NordVPN's recommended pick. So you can hard-code
|
||||
that server for a day or two as a workaround, until it degrades and you swap in another.
|
||||
|
||||
!!! note "Use `gb`, not `uk`, for the United Kingdom"
|
||||
Query the UK as `gb`. unshackle uses the Alpha-2 country code `gb` deliberately to stay
|
||||
@@ -451,13 +454,13 @@ unshackle dl --proxy nordvpn:us:seattle EXAMPLE 81234567
|
||||
## Proton VPN
|
||||
|
||||
Proton VPN supports two authentication methods, and unshackle can work with either. Note
|
||||
that free Proton accounts work but are limited to Proton's free-tier exit countries.
|
||||
that free Proton accounts work, but Proton limits them to its free-tier exit countries.
|
||||
|
||||
=== "TV login (recommended)"
|
||||
|
||||
A self-sustaining, refreshable session obtained through Proton's TV device-login flow.
|
||||
This is the only method that can refresh itself headlessly, so it keeps working without
|
||||
re-exporting anything. Enable it and run a download interactively once:
|
||||
Proton's TV device-login flow gives a self-sustaining, refreshable sign-in. This is
|
||||
the only method that can refresh itself headlessly, so it keeps working without
|
||||
re-exporting anything. Enable it and do a download interactively once:
|
||||
|
||||
```yaml title="unshackle.yaml"
|
||||
proxy_providers:
|
||||
@@ -467,26 +470,26 @@ that free Proton accounts work but are limited to Proton's free-tier exit countr
|
||||
|
||||
With `enable: true` and an interactive terminal, unshackle prints a code and asks you
|
||||
to enter it at [account.proton.me/vpn/tv/code](https://account.proton.me/vpn/tv/code).
|
||||
Once approved, the session is cached and reused automatically.
|
||||
Once you approve it, unshackle caches the sign-in and reuses it automatically.
|
||||
|
||||
=== "Exported cookies"
|
||||
|
||||
Export your `account.proton.me` session cookies (the `AUTH-<UID>` cookie) to the Proton
|
||||
Export your `account.proton.me` cookies (the `AUTH-<UID>` cookie) to the Proton
|
||||
cookie file. This method is **access-only**: it cannot refresh, so you must re-export
|
||||
when it expires.
|
||||
|
||||
!!! warning "The `AUTH-<UID>` cookie is HttpOnly"
|
||||
This is the single most common cause of a failed Proton cookie import: the required
|
||||
`AUTH-<UID>` cookie is **HttpOnly**, and many one-click cookie-export extensions
|
||||
silently skip HttpOnly cookies by default. If your import "doesn't work," use an
|
||||
silently skip HttpOnly cookies by default. If your import "does not work," use an
|
||||
exporter that explicitly includes HttpOnly cookies.
|
||||
|
||||
!!! note "Why this session can't refresh, and lapses after ~24h"
|
||||
Proton rotates browser refresh tokens and ties them to the live browser, so a
|
||||
headless refresh is impossible. unshackle therefore deliberately uses only the
|
||||
cookie's short-lived **access token** and never attempts a refresh, which is why the
|
||||
session lapses at Proton's ~24h TTL and must be re-exported. This is exactly why TV
|
||||
login is preferred for set-and-forget use.
|
||||
cookie's short-lived **access token** and never attempts a refresh. That is why
|
||||
the sign-in lapses at Proton's ~24h TTL and you must export it again. This is
|
||||
exactly why TV login is the better method for set-and-forget use.
|
||||
|
||||
**Default file locations:**
|
||||
|
||||
@@ -495,14 +498,14 @@ that free Proton accounts work but are limited to Proton's free-tier exit countr
|
||||
| Cookies | `{cookies}/vpn/protonvpn.txt` |
|
||||
| Session cache | `{cache}/vpn/protonvpn.json` |
|
||||
|
||||
Proton VPN **auto-loads** if its cookie file exists. Like ExpressVPN, its cached session
|
||||
is written with `0600` permissions.
|
||||
Proton VPN **auto-loads** if its cookie file exists. Like ExpressVPN, unshackle writes
|
||||
its cache file with `0600` permissions.
|
||||
|
||||
!!! note "Cache vs cookie precedence"
|
||||
If both a TV-login cache and a cookie file exist, the **cache is preferred** unless the
|
||||
cookie file is newer. Cookies are read fresh every run and never written back to the
|
||||
cache. So to deliberately force use of the cookie session, just re-save (re-export) the
|
||||
cookie file so its modification time is newer than the cache.
|
||||
If both a TV-login cache and a cookie file exist, unshackle **prefers the cache**
|
||||
unless the cookie file is newer. unshackle reads cookies fresh every run and never
|
||||
writes them back to the cache. So to deliberately force use of the cookie file,
|
||||
re-save (re-export) it so its modification time is newer than the cache.
|
||||
|
||||
**Query forms (after the `protonvpn:` prefix):**
|
||||
|
||||
@@ -513,12 +516,12 @@ is written with `0600` permissions.
|
||||
| `us:ny` | A server in New York. |
|
||||
|
||||
The returned proxy is HTTPS on **port 4443** (or **port 443** for Secure Core servers).
|
||||
Secure Core and Tor servers are excluded from selection because they are too slow for a
|
||||
plain proxy. On success, unshackle prints a summary such as `(Name - City): server-host`.
|
||||
unshackle excludes Secure Core and Tor servers from selection because they are too slow
|
||||
for a plain proxy. On success, unshackle prints a summary such as `(Name - City): server-host`.
|
||||
|
||||
!!! tip "Proton server numbers aren't sequential"
|
||||
When pinning a server with `protonvpn:deNN`, don't guess a low number. A country may
|
||||
expose non-contiguous IDs like `#203`, `#813`, and so on. Copy the number from a
|
||||
When pinning a server with `protonvpn:deNN`, do not guess a low number. A country may
|
||||
have non-contiguous IDs like `#203`, `#813`, and so on. Copy the number from a
|
||||
previous run's log line (e.g. `DE#203`) instead.
|
||||
|
||||
## Hola
|
||||
@@ -526,7 +529,7 @@ plain proxy. On success, unshackle prints a summary such as `(Name - City): serv
|
||||
Hola requires no configuration at all. It uses the
|
||||
[`hola-proxy`](https://github.com/Snawoot/hola-proxy) binary, and **auto-loads** whenever
|
||||
that binary is found on your `PATH`. If you query Hola but the binary is missing, the
|
||||
provider raises an error telling you to install it.
|
||||
proxy provider raises an error that tells you to install it.
|
||||
|
||||
```shell title="Install hola-proxy, then just query a country"
|
||||
unshackle dl --proxy hola:us EXAMPLE 81234567
|
||||
@@ -542,7 +545,7 @@ for available proxies in that country and picks one at random, returning an HTTP
|
||||
|
||||
## Surfshark
|
||||
|
||||
Surfshark, like NordVPN, uses **Service Credentials** rather than your login. Generate
|
||||
Surfshark, like NordVPN, uses **Service Credentials** rather than your login. Make
|
||||
them from the [Surfshark manual-setup page](https://my.surfshark.com/vpn/manual-setup/main/openvpn).
|
||||
|
||||
```yaml title="unshackle.yaml"
|
||||
@@ -571,8 +574,8 @@ The returned proxy is HTTPS on **port 443**.
|
||||
## Windscribe
|
||||
|
||||
Windscribe uses **Service Credentials** from its
|
||||
[OpenVPN config page](https://windscribe.com/getconfig/openvpn). Only the presence of a
|
||||
username and password is checked (there is no 48-character rule).
|
||||
[OpenVPN config page](https://windscribe.com/getconfig/openvpn). unshackle only makes
|
||||
sure that a username and a password are present (there is no 48-character rule).
|
||||
|
||||
```yaml title="unshackle.yaml"
|
||||
proxy_providers:
|
||||
@@ -598,11 +601,11 @@ proxy_providers:
|
||||
The returned proxy is HTTPS on **port 443**.
|
||||
|
||||
!!! warning "Windscribe is not loaded by the REST API resolver"
|
||||
The standalone Windscribe provider (and Gluetun) are loaded by the `dl` command, but
|
||||
**not** by the proxy resolver used by the REST API and remote-download client. If you
|
||||
drive downloads through the API and need Windscribe
|
||||
or Gluetun exits, resolve the proxy on the CLI side or use a different provider for API
|
||||
jobs. See the developer note below.
|
||||
The `dl` command loads the standalone Windscribe proxy provider (and Gluetun), but
|
||||
the proxy resolver that the REST API and the remote-download client use does **not**.
|
||||
If you drive downloads through the API and need Windscribe or Gluetun exits, get the
|
||||
proxy on the CLI side, or use a different proxy provider for API jobs. See the
|
||||
developer note below.
|
||||
|
||||
## Developer notes
|
||||
|
||||
@@ -618,22 +621,22 @@ The returned proxy is HTTPS on **port 443**.
|
||||
|
||||
Both paths accept the same query grammar (a direct URI, a `provider:query`, or a bare
|
||||
country query tried against providers in order), but the set of available providers
|
||||
differs. Keep this in mind when adding a provider: wiring it into `dl.py` does not make
|
||||
it available over the API, and vice versa.
|
||||
differs. Keep this in mind when you add a proxy provider: an entry in `dl.py` does not
|
||||
make it available over the API, and the opposite is also true.
|
||||
|
||||
!!! note "Implementing a new provider (developers)"
|
||||
Every provider subclasses `unshackle.core.proxies.proxy.Proxy` and implements three
|
||||
Every proxy provider subclasses `unshackle.core.proxies.proxy.Proxy` and has three
|
||||
methods:
|
||||
|
||||
- `__init__(self, **kwargs)` receives its `proxy_providers` sub-dict splatted as
|
||||
keyword arguments, so YAML keys map 1:1 to constructor parameters. Do authentication
|
||||
and catalog pre-fetching here.
|
||||
and catalogue pre-fetching here.
|
||||
- `__repr__(self)` is a human summary, conventionally `"{n} Countries ({m} Servers)"`.
|
||||
- `get_proxy(self, query)` returns a Requests-compatible proxy URI, or `None` only
|
||||
when the query was valid but no proxy exists. Raise on genuine errors or bad queries.
|
||||
|
||||
Optionally expose `get_connection_info(query)` (as Gluetun does) or
|
||||
`last_connection_display()` (as ExpressVPN and Proton VPN do) to have `dl` print a
|
||||
Optionally add `get_connection_info(query)` (as Gluetun does) or
|
||||
`last_connection_display()` (as ExpressVPN and Proton VPN do) to make `dl` print a
|
||||
friendly connection line instead of the raw proxy URL.
|
||||
|
||||
## See also
|
||||
|
||||
Reference in New Issue
Block a user