session: move plugin load/resolve logic #5814
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
streamlink.session.plugins
module with theStreamlinkPlugins
classStreamlink.plugins
an instance of this classplugins_builtin
keyword argument to theStreamlink
class and set its default value toTrue
Streamlink.{{get,load}_plugins,load_builtin_plugins}()
methods, which are now wrappers for the respectiveStreamlinkPlugins
implementationsstreamlink_cli.main
and all otherStreamlink
session usages accordingly (in scripts and tests)Ref #4741
Part 3/x
Follow-up of #5807
These changes here are separate of the lazy plugin loader implementation (based on #5793) and are a necessary preparation step for that. Instead of moving the load/resolve logic and adding the lazy plugin loading in a single commit, this makes it easier to understand.
The deprecations are currently not documented. I will do this later in another PR which will also document the deprecations added by #5807.
I was also thinking about adding a CLI argument for disabling the loading of built-in plugins, since this is now controlled via a keyword on the
Streamlink
session class. A new CLI argument for disabling lazy-loading will be added anyway, so adding this one kind of makes sense, in case someone is interested in loading only their custom plugins (regular sideloading or--plugins-dir
(that arg needs to be changed btw, from a comma-delimited string of paths to a repeatable CLI argument)). But that can be done later, based on these changes here.https://deploy-preview-5814--streamlink.netlify.app/api/session