session: move plugin load/resolve logic#5814
Merged
Merged
Conversation
15df7d8 to
478685a
Compare
- Move plugin load/resolve logic into the `streamlink.session.plugins`
module with the `StreamlinkPlugins` class
- Make `Streamlink.plugins` an instance of this class
- Add the `plugins_builtin` keyword argument to the `Streamlink` class
and set its default value to `True`
- Deprecate the `Streamlink.{{get,load}_plugins,load_builtin_plugins}()`
methods, which are now wrappers for the respective `StreamlinkPlugins`
implementations
- Update `streamlink_cli.main` and all other `Streamlink` session
usages accordingly (in scripts and tests)
- Update session docs
- Move and update plugin load/resolve tests
478685a to
383822d
Compare
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.pluginsmodule with theStreamlinkPluginsclassStreamlink.pluginsan instance of this classplugins_builtinkeyword argument to theStreamlinkclass and set its default value toTrueStreamlink.{{get,load}_plugins,load_builtin_plugins}()methods, which are now wrappers for the respectiveStreamlinkPluginsimplementationsstreamlink_cli.mainand all otherStreamlinksession 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
Streamlinksession 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