refactor(proxies): apply a service proxy_map before the proxy resolves

This commit is contained in:
imSp4rky
2026-11-27 11:53:06 -07:00
parent 387ce53e84
commit 84751b1f9e
11 changed files with 138 additions and 83 deletions
+2 -3
View File
@@ -116,9 +116,8 @@ up the objects your methods rely on:
| `self.credential` | The active `Credential`, or `None` until authenticated. |
| `self.track_request` | A `TrackRequest` describing the requested codecs, ranges, and best-available flag (see below). |
The constructor also resolves proxies: it reads `--proxy` and the `proxy_query` and
`proxy_provider` context params that `dl` and `search` derive from it, consults the per-service
`proxy_map`, and, if `GEOFENCE` is set and you did not give an explicit proxy, does a live
The constructor also resolves proxies: it reads `--proxy`, which `dl` and `search` have already
resolved through the per-service `proxy_map`, and, if `GEOFENCE` is set and you did not give an explicit proxy, does a live
IP check and auto-fetches a proxy to `GEOFENCE[0]` when it detects a geoblock. A
`GEOBLOCK` hit with no `GEOFENCE` stops the run with a "not available in your region"
error, because there is no main region to fetch a proxy for; pass `--proxy` yourself.
+4 -3
View File
@@ -7,9 +7,10 @@
Per-service configuration, keyed by the service tag in any case (for example `EXAMPLE1`, `EXAMPLE2`,
`EXAMPLE3`). unshackle reads several well-known sub-keys out of each service's block:
- **`proxy_map`**: remaps the region query you passed to `-p/--proxy` for this service.
A config key is that query, or `"provider:query"` when the flag also named a proxy provider. The value is
the query asked of the proxy provider instead. It has no effect when you give `-p` a full proxy URL.
- **`proxy_map`**: remaps the region query you passed to `--proxy` for this service.
A config key is that query, or `"provider:query"` when the flag also named a proxy provider, in any case. The value is
the query asked of the proxy provider instead. When no proxy provider answers it, unshackle logs a warning and asks
the original query. It has no effect when you give `--proxy` a full proxy URL.
`dl`, `search` and a REST API download job apply it. The other REST API routes and a `--remote` remote session do not.
- **`title_map`**: an exact-match rename map applied to fetched titles (source name →
desired name), so a service that names a title differently from your library still matches.