1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-06-28 01:18:30 +00:00

Don't load plugins by default

This commit is contained in:
grqx_wsl 2025-04-23 15:51:33 +12:00
parent 9c771dd218
commit d147c9c369
2 changed files with 5 additions and 3 deletions

View File

@ -51,7 +51,7 @@ def run_tests(*tests, pattern=None, ci=False, load_plugins=False):
try: try:
return subprocess.call(arguments, env={ return subprocess.call(arguments, env={
**os.environ, **os.environ,
'YTDLP_NO_PLUGINS': '1' if os.environ.get('YTDLP_NO_PLUGINS') or not load_plugins else '', '_YT_DLP_TEST_DO_LOAD_PLUGINS': '1' if load_plugins else '',
}) })
except FileNotFoundError: except FileNotFoundError:
pass pass

View File

@ -1,6 +1,7 @@
import errno import errno
import hashlib import hashlib
import json import json
import os
import os.path import os.path
import re import re
import ssl import ssl
@ -87,8 +88,9 @@ def report_warning(self, message, *args, **kwargs):
def gettestcases(include_onlymatching=False): def gettestcases(include_onlymatching=False):
import yt_dlp.plugins if os.environ.get('_YT_DLP_TEST_DO_LOAD_PLUGINS'):
yt_dlp.plugins.load_all_plugins() import yt_dlp.plugins as plugins
plugins.load_all_plugins()
for ie in yt_dlp.extractor.gen_extractors(): for ie in yt_dlp.extractor.gen_extractors():
yield from ie.get_testcases(include_onlymatching) yield from ie.get_testcases(include_onlymatching)