Skip to content

Commit

Permalink
misc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
coletdjnz committed Dec 8, 2024
1 parent fff5e7b commit 0210836
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 0 additions & 2 deletions yt_dlp/YoutubeDL.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,6 @@
if os.name == 'nt':
import ctypes

__all__ = ['YoutubeDL']


def _catch_unsafe_extension_error(func):
@functools.wraps(func)
Expand Down
10 changes: 3 additions & 7 deletions yt_dlp/_globals.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from collections import defaultdict

# Internal only - no backwards compatibility guaranteed


class Indirect:
def __init__(self, initial, /):
Expand All @@ -9,23 +11,17 @@ def __repr__(self, /):
return f'{type(self).__name__}({self.value!r})'


# Internal only - no backwards compatibility guaranteed
postprocessors = Indirect({})
extractors = Indirect({})

IN_CLI = Indirect(False)
# `False`=force, `None`=disabled, `True`=enabled
LAZY_EXTRACTORS = Indirect(False)


# Plugins

plugin_specs = Indirect({})

# Whether plugins have been loaded once
all_plugins_loaded = Indirect(False)

plugins_enabled = Indirect(True)

plugin_dirs = Indirect(['external'])
plugin_ies = Indirect({})
plugin_overrides = Indirect(defaultdict(list))
Expand Down
2 changes: 1 addition & 1 deletion yt_dlp/utils/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
compat_HTMLParseError,
)
from ..dependencies import xattr
from .._globals import IN_CLI as _IN_CLI

__name__ = __name__.rsplit('.', 1)[0] # noqa: A001: Pretend to be the parent module

Expand Down Expand Up @@ -1483,7 +1484,6 @@ def write_string(s, out=None, encoding=None):

# TODO: Use global logger
def deprecation_warning(msg, *, printer=None, stacklevel=0, **kwargs):
from .._globals import IN_CLI as _IN_CLI
if _IN_CLI.value:
if msg in deprecation_warning._cache:
return
Expand Down

0 comments on commit 0210836

Please sign in to comment.