minor refactoring

This commit is contained in:
coletdjnz 2024-10-20 14:21:40 +13:00
parent 9811496c24
commit 27238028f4
No known key found for this signature in database
GPG key ID: 91984263BB39894A
2 changed files with 5 additions and 3 deletions

View file

@ -179,6 +179,8 @@ from .version import CHANNEL, ORIGIN, RELEASE_GIT_HEAD, VARIANT, __version__
if compat_os_name == 'nt':
import ctypes
__all__ = ['YoutubeDL']
def _catch_unsafe_extension_error(func):
@functools.wraps(func)

View file

@ -22,7 +22,7 @@ import urllib.parse
import urllib.request
import xml.etree.ElementTree
from .._globals import plugin_overrides
from .._globals import plugin_overrides as _plugin_overrides
from ..compat import (
compat_etree_fromstring,
compat_expanduser,
@ -3941,13 +3941,13 @@ class InfoExtractor:
while getattr(super_class, '__wrapped__', None):
super_class = super_class.__wrapped__
if not any(override.PLUGIN_NAME == plugin_name for override in plugin_overrides.get()[super_class]):
if not any(override.PLUGIN_NAME == plugin_name for override in _plugin_overrides.get()[super_class]):
cls.__wrapped__ = next_mro_class
cls.PLUGIN_NAME, cls.ie_key = plugin_name, next_mro_class.ie_key
cls.IE_NAME = f'{next_mro_class.IE_NAME}+{plugin_name}'
setattr(sys.modules[super_class.__module__], super_class.__name__, cls)
plugin_overrides.get()[super_class].append(cls)
_plugin_overrides.get()[super_class].append(cls)
return super().__init_subclass__(**kwargs)