Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session: move plugin load/resolve logic #5814

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

bastimeyer
Copy link
Member

@bastimeyer bastimeyer commented Feb 4, 2024

  • 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
15 checks passed
@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