mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 06:35:12 +00:00 
			
		
		
		
	[core] Load plugins on demand (#11305)
- Adds `--no-plugin-dirs` to disable plugin loading - `--plugin-dirs` now supports post-processors Authored by: coletdjnz, Grub4K, pukkandan
This commit is contained in:
		| @@ -6,6 +6,8 @@ import sys | ||||
| import unittest | ||||
| from unittest.mock import patch | ||||
| 
 | ||||
| from yt_dlp.globals import all_plugins_loaded | ||||
| 
 | ||||
| sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | ||||
| 
 | ||||
| 
 | ||||
| @@ -1427,6 +1429,12 @@ class TestYoutubeDL(unittest.TestCase): | ||||
|         self.assertFalse(result.get('cookies'), msg='Cookies set in cookies field for wrong domain') | ||||
|         self.assertFalse(ydl.cookiejar.get_cookie_header(fmt['url']), msg='Cookies set in cookiejar for wrong domain') | ||||
| 
 | ||||
|     def test_load_plugins_compat(self): | ||||
|         # Should try to reload plugins if they haven't already been loaded | ||||
|         all_plugins_loaded.value = False | ||||
|         FakeYDL().close() | ||||
|         assert all_plugins_loaded.value | ||||
| 
 | ||||
| 
 | ||||
| if __name__ == '__main__': | ||||
|     unittest.main() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 coletdjnz
					coletdjnz