GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Streamlink 8.6.3 documentation

This view

  • Original page
  • New address

GeezerVison is showing streamlink.github.io — Cache - Streamlink 8.6.3 documentation

Cache¶

class streamlink.cache.Cache(filename, key_prefix='', disabled=False)¶

Bases: object

Caches Python values as JSON and prunes expired entries.

Parameters:
  • filename (str | Path) -- A file name or Path object, relative to the cache directory

  • key_prefix (str) -- Optional prefix for each key to be retrieved from or stored in the cache

  • disabled (bool)

get(key, default=None)¶

Attempt to retrieve the given key from the cache.

Prunes the cache of all expired key-value pairs before retrieving the key's value.

Parameters:
  • key (str) -- A specific key name

  • default (Any | None) -- An optional default value if no key was stored, or if it has expired

Returns:

The retrieved value or optional default value

Return type:

Any

get_all()¶

Retrieve all cached key-value pairs.

Prunes the cache of all expired key-value pairs first.

Returns:

A dictionary of all cached key-value pairs.

Return type:

dict[str, Any]

set(key, value, expires=604800, expires_at=None)¶

Store the given value using the key name and expiration time.

Prunes the cache of all expired key-value pairs before setting the new key-value pair.

Parameters:
  • key (str) -- A specific key name

  • value (Any) -- Any kind of value that can be JSON-serialized

  • expires (float) -- Expiration time in seconds, with the default being one week

  • expires_at (datetime | None) -- Optional expiration date, which overrides the expiration time

Return type:

None

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.