Thanks to visit codestin.com
Credit goes to github.com

Skip to content

session: move plugin load/resolve logic#5814

Merged
bastimeyer merged 1 commit into
streamlink:masterfrom
bastimeyer:session/plugins/init
Feb 8, 2024
Merged

session: move plugin load/resolve logic#5814
bastimeyer merged 1 commit into
streamlink:masterfrom
bastimeyer:session/plugins/init

Conversation

@bastimeyer

@bastimeyer bastimeyer commented Feb 4, 2024

Copy link
Copy Markdown
Member
  • 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

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

- 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
@bastimeyer bastimeyer force-pushed the session/plugins/init branch from 478685a to 383822d Compare February 8, 2024 08:24
@bastimeyer bastimeyer merged commit c2f0626 into streamlink:master Feb 8, 2024
@bastimeyer bastimeyer deleted the session/plugins/init branch February 8, 2024 08:28
@W4RdZ W4RdZ mentioned this pull request May 9, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant