Commit Graph
164 Commits
Author SHA1 Message Date
imSp4rky 172b76bd76 fix(api): redact every form of a configured credential from job errors 2026-11-24 17:13:17 -07:00
imSp4rky 4692e6bb96 fix(drm): end a licence with no usable key in one line for every DRM system 2026-11-24 17:13:08 -07:00
imSp4rky d954f61100 fix(api): evict a session of the key that holds the most at max_sessions 2026-11-24 16:56:21 -07:00
imSp4rky 7735c43061 fix(remote): answer malformed input with one line and keep secrets out of logs 2026-11-24 16:56:17 -07:00
imSp4rky 3e8c63b067 refactor(remote): send every client call through RemoteClient 2026-11-24 16:52:44 -07:00
imSp4rky 5ab60b8879 fix(remote): send a service option under its served name 2026-11-24 16:47:45 -07:00
imSp4rky 8d5234130a refactor(remote): keep the session protocol in core/remote_protocol.py 2026-11-24 16:20:33 -07:00
imSp4rky 6c334d31a7 refactor(api): keep the dl option facts in one table in core/dl_options.py 2026-11-24 15:14:38 -07:00
imSp4rky bbe58930b5 refactor(dl): move content-key resolution into core/drm/key_resolution.py 2026-11-24 14:44:47 -07:00
imSp4rky 55138f95c2 refactor(core): move the title, track and DRM wire form into core/wire.py 2026-11-24 14:37:51 -07:00
Jakub Rybakowski 661be3ee0d feat(api): expose optional account-scoped title availability 2026-11-23 18:54:36 -06:00
imSp4rky c818ec3bbe fix(api): refuse deeply nested cache payloads by depth, not RecursionError 2026-11-23 17:50:50 -07:00
imSp4rky 9693cbd39c fix(api): convert quality to heights for remote sessions
A string or zero -q from a REST client reached the service as raw text; it now gets the same checked height list as dl.
2026-11-16 14:44:47 -07:00
imSp4rky f1e4081313 feat(serve): per-api-key cdm and service config with server-side identity cache
serve.users.<key>.cdm and service_config give each API key its own device and service config. Service.IDENTITY_CACHE keys route to a per-key directory that clients never receive
2026-11-16 13:31:17 -07:00
imSp4rky 856a193061 feat(tracks): support HDR Vivid and Audio Vivid
Add Video.Range.VIVID and Audio.Codec.AV3A, found by the first-segment probe (CUVA SEI, MPEG-TS cuvv/AVSA/0xD5); sort videos by standard resolution, then bitrate; drop service names left in core and tests. Closes #179
2026-11-14 22:03:13 -07:00
imSp4rky 7a5ad5024a feat(music): pick the song container from the codec in the downloaded file
FFprobe sets the codec; DTS goes to .mka, PCM to .flac or .wav, AC-4/MPEG-H/DTS-UHD to MP4Box. The remux also cuts --sample, --no-mux no longer applies to a Song, and the tagger adds cover fallback, WebP, ARTISTS and ReplayGain. Song tag data now reaches a --remote client.
2026-11-14 19:58:21 -07:00
imSp4rky 6964f58271 feat(dl): add --skip-missing to skip titles that miss a required language or track
A season run skips such a title and continues; one title, or a run that skips every title, still exits 1 (now also for -ado/-fso). REST jobs report skipped_titles.
2026-11-13 18:30:01 -07:00
imSp4rky 7f91a1d36b feat(drm): license a track only when its own KID has no key
A vault key for the track's KID now stands in for the licence on the client and the server (PlayReady included). decrypt_verified licenses any other header KID the file uses.
2026-11-12 18:03:16 -07:00
imSp4rky 16fbf5d17a fix(remote): report each handled remote error once, from the code that catches it
A caught RemoteError now logs at debug under quiet(); a recovered licence prints one warning, only when the track's own key is held.
2026-11-12 17:15:40 -07:00
imSp4rky dc18b23b91 fix(remote): keep vault keys when a relayed licence is refused
proxy_license now raises ClickException instead of RemoteError (a SystemExit), so dl falls back to the track's vault key; licence messages name the track ("video 360p DV (592464997)").
2026-11-12 16:14:34 -07:00
imSp4rky e29a523907 feat(tracks): download and mux stereoscopic 3D (MV-HEVC) video to MP4
Mark 3D from REQ-VIDEO-LAYOUT, DV profile 20 codecs or an lhvC box; mux with MP4Box, decrypt with mp4decrypt, skip FFmpeg repack, sample cut and hybrid; add {3d} and env MP4Box.
2026-11-12 04:47:18 -07:00
imSp4rky b4418fa731 test: install the EXAMPLE service through a fixture, not the live config
Two tests failed when the local unshackle.yaml left out the in-repo services folder.
2026-11-09 20:04:28 -07:00
imSp4rky 6f9ab94536 feat(tunnel): route --local-proxy through a typed --proxy
The client dials the server's targets through the proxy (http/https CONNECT or SOCKS5, with login), with the same target checks and no direct fallback. tunnel-test takes --proxy too.
2026-11-09 19:38:01 -07:00
imSp4rky b10fd2d3a4 feat(tunnel): free finished tunnels at once and wait out 429s on --remote
A tunnel closed with code 1000 is freed without the 60s grace, a shared: true API key counts tunnels per X-Client-Id, and --remote waits out Retry-After and a full tunnel cap with a countdown; responses carry X-RateLimit-* headers.
2026-11-09 15:43:33 -07:00
imSp4rky b3d586a590 feat(api): carry the service catalogue on /api/dashboard/services
Rows now include the /api/services fields (help, cli_params, auth_methods, ...) and server_accounts. Both routes build the catalogue off the event loop, and an enum choice or a non-JSON list default no longer fails the whole route.
2026-11-03 18:27:49 -07:00
imSp4rky 87ccd6666c fix(api)!: key the health route and keep server internals from user keys
/api/health needs X-Secret-Key but stays outside the rate limit. Only the admin key gets load_errors from /api/services, default error details no longer name the exception class, and a prepare signal replaces aiohttp's Server banner on every response while the CDM routes keep their own.
2026-11-03 11:53:55 -07:00
imSp4rky b6429ecdfd feat(remote): match the server CDM to the client's DRM and read vaults first
A dual widevine/playready cdm entry now loads the device of the client's DRM system, for old clients too since they already send cdm_type. A new client hands a capped track to its own device for the track's DRM system, and raises the refusal only after its local vaults miss.
2026-11-03 10:51:29 -07:00
imSp4rky 3027592e31 fix: drop null vault keys, cap snapshot restore size, isolate test globals
Vaults.add_keys and kv add skip null content keys instead of failing the batch; is_null_key moves to core.vault. A manifest snapshot restore has one 32 MiB inflate budget. Tests reset the speed limiter and config between runs.
2026-11-02 22:01:02 -07:00
imSp4rky c4677341c8 refactor(drm): resolve content keys in one licence path behind ServerKeySource
Drop null keys from every licence, server and export source, not only Widevine. dl now finds remote sessions and imports through ServerKeySource instead of private fields.
2026-11-02 21:13:23 -07:00
imSp4rky 842ece3802 fix(manifests): skip filtered dash periods after the main content and keep them over export
A manifest snapshot module now saves and restores DASH/ISM parser state for --remote and export/import, so an import keeps the service's period filter without fetching the manifest.
2026-11-02 20:41:27 -07:00
imSp4rky eeff83b820 fix(api): cast download job options with the dl click types
cast_dl_params feeds ctx.params to dl() and dl.result() as on the CLI. A string lang value now returns 400 instead of splitting into letters, and -r accepts HDR10+.
2026-11-02 20:30:40 -07:00
imSp4rky e685710fba refactor(api): register each route once and merge duplicated handler code
Swagger now owns route registration instead of adding a second dead copy of every route; add json_body, enqueue_job, serialize_tracks and client_credential, build the serve middleware list once, and scan the users once per request.
2026-11-02 15:06:52 -07:00
imSp4rky 47d9e3d3c9 perf(api): move blocking file and hash work off the event loop
Run session-tracks serialization, request cache IO, session cache dir removal (now outside the store lock), history reads and gzip over 1 MiB on worker threads; cache the per-key PBKDF2 namespace and key_id.
2026-11-02 14:59:04 -07:00
imSp4rky f6ce600d71 perf(api)!: cut per-request and per-tick event bus traffic
Session update events carry the new action as action_entry instead of the full log; access lines stay out of the log ring unless --debug. Job events build and redact their dict once, the progress interval matches the 0.5 s poll, and dashboard stats are serialized once.
2026-11-02 14:52:18 -07:00
imSp4rky bb081046e2 perf(api): stop rebuilding proxy catalogues, vaults and cdms per request
Cache proxy provider catalogues (10 min), reuse vaults and CDMs across one batch licence call, and cache the health update check, /api/services entries and parsed service config.yaml.
2026-11-02 14:40:58 -07:00
imSp4rky 31328dc109 fix(drm): retry a licence call only for an argument the service rejects
A TypeError raised inside the service no longer sends the challenge again.
2026-11-02 09:01:42 -07:00
imSp4rky 65c8e60a7a fix(api): check and cast download job service options like a session does
A bad value now gets 400 INVALID_PARAMETERS at submit and the worker casts each option; a flat dl key such as quality or lang no longer fills a service option of the same name.
2026-11-01 20:21:42 -07:00
imSp4rky de9646dba2 fix(api): skip the local geoblock for a relayed tag not installed here 2026-11-01 20:06:09 -07:00
imSp4rky 99f0c269be fix(api): refuse a non-public proxy host for a key without server_proxy
Closes the loopback and LAN route to the server's own forwarders, including backslash, percent-escape and *.localhost forms.
2026-11-01 20:04:06 -07:00
imSp4rky e509db618e fix(api): keep a pooled remote session to the api key that opened it
The pool key now includes the caller's API key and client_region, so a hit never skips the server_proxy and region checks that a fresh session runs.
2026-11-01 19:47:19 -07:00
imSp4rky 67d3d4801f fix(remote): send a service's filtered dash periods so the client skips them too 2026-11-01 16:35:06 -07:00
imSp4rky 65e807bf5f fix(subtitle): join cues that a segment boundary splits in stpp and wvtt
Share one append_cue join across DASH fTTML, ISM and fVTT parsing. Also map "geo-block" and "geolocation" errors to GEOFENCE in the API.
2026-10-31 15:59:12 -06:00
imSp4rky c6c0331007 refactor(dl): share the cache, vault and key-label steps in prepare_drm
take_cached_key, take_vault_key and add_key_label replace the code copied across the server-CDM, Widevine, PlayReady, ClearKey and MonaLisa branches.
2026-10-31 13:28:29 -06:00
imSp4rky e6a627118f feat(tracks): add a display-only note shown in --list and over --remote 2026-10-30 16:17:36 -06:00
imSp4rky 5206b3cab6 refactor(remote)!: send service options only in service_params
A service option named like a dl option (e.g. --profile) is no longer dropped or mixed with the dl value; the server casts nested values and keeps cli defaults nested.
2026-10-30 16:16:56 -06:00
imSp4rky bd64f3a8c4 fix(api): stop a service's sys.exit from killing the serve process
Catch SystemExit at service import, in the heartbeat task, the 5xx middleware, search, samples and chapters, and answer it as SERVICE_ERROR.
2026-10-29 11:23:53 -06:00
imSp4rky 7b927934e0 feat(remote)!: let server_cdm outrank a service's cdm entry and set it per service
server_cdm: true on a remote_services entry now licenses remote runs with the server CDM even when the service has its own cdm entry, which stays the local-run device and the fallback. A services.<TAG>.server_cdm replaces the server value for one service, per-service entries match the tag in any case, and the configured fallback logs at info.

BREAKING CHANGE: with server_cdm: true, a per-service cdm entry no longer makes your own device license remote sessions; use dl --cdm or services.<TAG>.server_cdm: false.
2026-10-29 10:18:15 -06:00
imSp4rky d12a943d96 fix(api): show filename codec and range labels in codec_display and range_display 2026-10-28 15:34:52 -06:00
imSp4rky 756c2ce2b5 feat(remote): reopen a lost remote session and resume at the current title 2026-10-27 13:24:31 -06:00
imSp4rky 9017ab95b7 feat(tracks): add Video.hdr10_base and forward s_lang over remote and REST
A DV track with an HDR10 base (profile 8.1) lists as DV+HDR10; dl_params now carry s_lang.
2026-10-27 13:06:48 -06:00