fix(title-cache): key a cookie-only login by its cookie file path

This commit is contained in:
imSp4rky
2026-12-02 15:24:00 -07:00
parent 3868928d98
commit 2c305c475f
5 changed files with 79 additions and 6 deletions
+4 -2
View File
@@ -650,14 +650,16 @@ prepared, all derived from the Click context (`ctx`) that `dl` passes in.
everywhere. (unshackle also ships an rnet-based TLS-fingerprinting HTTP session that the
newer `session()` factory uses and that the `network` config key configures.)
- **`self.credential`**: the active `Credential` (`username:password[:extra]`), populated
by `authenticate`. unshackle uses its `sha1` as the account hash for cache keys.
by `authenticate`. unshackle uses its `sha1` as the account hash for cache keys. A login
with cookies only uses a hash of the path of its cookie file.
- **`self.cache`**: a generic `Cacher`: JSON key/value storage under the service's cache
dir, with CRC32 integrity checks, versioning, and optional expiry (auto-derived from a
JWT `exp` claim when present). Good for auth tokens and API responses.
- **`self.title_cache`**: a `TitleCacher` that wraps `get_titles` results, keyed by title
ID, region, and account hash. It serves fresh data within `title_cache_time`, falls back
to stale data within `title_cache_max_retention` when an API call fails, and `--no-cache`
bypasses it.
bypasses it. If you put the cookies of a different account into the same cookie file, use
`--reset-cache` once.
- **`self.track_request`**: the `TrackRequest` describing what the user asked for
(codecs, ranges, best-available), for use inside `get_tracks`.