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

[plugins] Load plugins on demand #11305

Open
wants to merge 72 commits into
base: master
Choose a base branch
from

Conversation

coletdjnz
Copy link
Member

@coletdjnz coletdjnz commented Oct 21, 2024

  • Load plugins when requested, rather than automatically on import.

    • By default, YoutubeDL will request for plugins to be loaded if they have not already been
  • Add --no-plugin-dirs to disable plugin loading

  • Improved --plugin-dirs to support post processors; ability to disable looking in external locations.

You can specify --plugin-dirs after --no-plugin-dirs to restrict plugin dirs

Added python APIs to interact with plugin loading logic:

  • register_plugin_spec(plugin_spec: PluginSpec) - add a new plugin specification (e.g. something other than extractors/post-processors)
  • clear_plugins()
  • load_all_plugins()
  • load_plugins(plugin_spec: PluginSpec)
Template

Before submitting a pull request make sure you have:

In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)
    grub4k, pukkandan

What is the purpose of your pull request?

@coletdjnz coletdjnz added the enhancement New feature or request label Oct 21, 2024
@coletdjnz coletdjnz changed the title [plugins] Improvements WIP [plugins] Load plugins on demand Nov 30, 2024
coletdjnz and others added 3 commits February 9, 2025 10:45
Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
README.md Outdated Show resolved Hide resolved
Copy link
Member

@bashonly bashonly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First impressions. I'll look at it again soon and hopefully have a better grasp on it then

Don't miss my lazy extractors comment amid my sea of pedantry

yt_dlp/options.py Outdated Show resolved Hide resolved
yt_dlp/extractor/extractors.py Show resolved Hide resolved
yt_dlp/plugins.py Outdated Show resolved Hide resolved
yt_dlp/plugins.py Outdated Show resolved Hide resolved
yt_dlp/plugins.py Outdated Show resolved Hide resolved
yt_dlp/plugins.py Show resolved Hide resolved
yt_dlp/plugins.py Outdated Show resolved Hide resolved
yt_dlp/plugins.py Outdated Show resolved Hide resolved
yt_dlp/options.py Outdated Show resolved Hide resolved
coletdjnz and others added 13 commits February 11, 2025 19:31
Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
pyproject.toml Outdated Show resolved Hide resolved
coletdjnz and others added 3 commits February 11, 2025 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Nice to have
Development

Successfully merging this pull request may close these issues.

4 participants