Options#
- class streamlink.options.Options(defaults=None)#
Bases:
object
For storing options to be used by the Streamlink session and plugins, with default values.
- Note: Option names are normalized by replacing "_" with "-".
This means that the keys
example_one
andexample-one
are equivalent.
- Parameters:
defaults (Mapping[str, Any] | None) --
- clear()#
Restore default options
- Return type:
None
- get(key)#
Get the stored value of a specific key
- Parameters:
key (str) --
- Return type:
Any
- get_explicit(key)#
Get the stored value of a specific key and ignore any get-mappings
- Parameters:
key (str) --
- Return type:
Any
- set(key, value)#
Set the value for a specific key
- Parameters:
key (str) --
value (Any) --
- Return type:
None
- set_explicit(key, value)#
Set the value for a specific key and ignore any set-mappings
- Parameters:
key (str) --
value (Any) --
- Return type:
None
- update(options)#
Merge options
- Parameters:
options (Mapping[str, Any]) --
- Return type:
None
- class streamlink.options.Argument(name, required=False, requires=None, prompt=None, sensitive=False, argument_name=None, dest=None, **options)#
Bases:
object
Accepts most of the parameters accepted by
ArgumentParser.add_argument()
, except thatrequires
is a special case which is only enforced if the plugin is in use. In addition, thename
parameter is the name relative to the plugin name, but can be overridden byargument_name
.Should not be called directly, see the
pluginargument
decorator.- Parameters:
name (str) -- Argument name, without leading
--
or plugin name prefixes, e.g."username"
,"password"
, etc.required (bool) -- Whether the argument is required for the plugin
requires (str | Sequence[str] | None) -- List of arguments which this argument requires, eg
["password"]
prompt (str | None) -- If the argument is required and not set, this prompt message will be shown instead
sensitive (bool) -- Whether the argument is sensitive (passwords, etc.) and should be masked
argument_name (str | None) -- Custom CLI argument name without plugin name prefix
dest (str | None) -- Custom plugin option name
options -- Arguments passed to
ArgumentParser.add_argument()
, excludingrequires
anddest