mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 06:35:12 +00:00 
			
		
		
		
	Improve plugin architecture (#5553)
to make plugins easier to develop and use: * Plugins are now loaded as namespace packages. * Plugins can be loaded in any distribution of yt-dlp (binary, pip, source, etc.). * Plugin packages can be installed and managed via pip, or dropped into any of the documented locations. * Users do not need to edit any code files to install plugins. * Backwards-compatible with previous plugin architecture. As a side-effect, yt-dlp will now search in a few more locations for config files. Closes https://github.com/yt-dlp/yt-dlp/issues/1389 Authored by: flashdagger, coletdjnz, pukkandan, Grub4K Co-authored-by: Marcel <flashdagger@googlemail.com> Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com> Co-authored-by: Simon Sawicki <accounts@grub4k.xyz>
This commit is contained in:
		| @@ -33,14 +33,15 @@ from .movefilesafterdownload import MoveFilesAfterDownloadPP | ||||
| from .sponskrub import SponSkrubPP | ||||
| from .sponsorblock import SponsorBlockPP | ||||
| from .xattrpp import XAttrMetadataPP | ||||
| from ..utils import load_plugins | ||||
| from ..plugins import load_plugins | ||||
| 
 | ||||
| _PLUGIN_CLASSES = load_plugins('postprocessor', 'PP', globals()) | ||||
| _PLUGIN_CLASSES = load_plugins('postprocessor', 'PP') | ||||
| 
 | ||||
| 
 | ||||
| def get_postprocessor(key): | ||||
|     return globals()[key + 'PP'] | ||||
| 
 | ||||
| 
 | ||||
| globals().update(_PLUGIN_CLASSES) | ||||
| __all__ = [name for name in globals().keys() if name.endswith('PP')] | ||||
| __all__.extend(('PostProcessor', 'FFmpegPostProcessor')) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Matthew
					Matthew