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

leverage entry points for enumerating new extractors #22913

Closed
darkdragn opened this issue Oct 30, 2019 · 1 comment
Closed

leverage entry points for enumerating new extractors #22913

darkdragn opened this issue Oct 30, 2019 · 1 comment
Labels

Comments

@darkdragn
Copy link

@darkdragn darkdragn commented Oct 30, 2019

Checklist

  • I'm reporting a feature request
  • I've verified that I'm running youtube-dl version 2019.10.29
  • I've searched the bugtracker for similar feature requests including closed ones

Description

Topic

Code management, and new feature introduction.

This is going to sound a little pretentious, and I am sorry before hand. I love the work your team does, and I'm in the process of writing a few extractors, but I started to get curious about one point in your code base. That point being, has the team considered using entry points to load extractors and separating the codebase to more easily track issues or allow custom extractors?

If anyone is unfamiliar with entry points, python's documentation is sufficient, but here's a humorous walk through: Snek

Proposal

Separating codebase in to multiple projects. A quick patch to youtube_dl.extractors.init.py adding something similar to:

import pkg_resources
for entry_point in pkg_resources.iter_entry_points('youtube_dl_extractors'):
    _ALL_CLASSES.append(entry_point.load())

Could be sufficient enough to enable this capability.

Benefits

  • Tracking extractor issues separate from core code issues
  • Separating the extractors into different bundles (I.E. nsfw, anime, live, news...)
  • Allowing for developers to test / maintain their extractors separate from the youtube-dl codebase (For example, instead of forking youtube-dl to write an extractor, just provide a cookiecutter template with an entrypoint and install it in a venv to play with an test)
  • Meta packages: you could either make bundles of extractors be extras (youtube-dl[nsfw]) or provide metapackages that are just a setup.py and a requirements.txt, the requirements file listing the extractor plugins (youtube-dl-nsfw)

Afterword

Sorry if this has been proposed before. I spend a good 30+ minutes searching the issues and couldn't find a proposal like this, but I really think the community and your team could benefit from a restructuring like this. If your team supports this, I would be more than willing to kick everything off, and put forward a beta, I just don't want to run the leg work, if the team has any objections.

Thank you for your time. Thank you and your team for a wonderful project, and I with the project all the best going forward.

@darkdragn darkdragn added the request label Oct 30, 2019
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Oct 30, 2019

This has been discussed numerous times. For now there are neither plans nor resources for that.

@dstftw dstftw closed this Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.