Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions stubs/yt-dlp/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ yt_dlp.utils.(_utils.)?prepend_extension
yt_dlp.utils.(_utils.)?replace_extension
# Unsure why this is here.
yt_dlp.utils.jslib.devalue.TYPE_CHECKING
# internal API:
yt_dlp.utils._jsruntime.runtime_version_tuple
2 changes: 1 addition & 1 deletion stubs/yt-dlp/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version = "2025.10.22"
version = "2025.11.12"
upstream_repository = "https://github.com/yt-dlp/yt-dlp"
requires = ["websockets"]
2 changes: 2 additions & 0 deletions stubs/yt-dlp/yt_dlp/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ class _Params(TypedDict, total=False):
default_search: str | None
dynamic_mpd: bool | None
extractor_args: Mapping[str, Mapping[str, Any]] | None
js_runtimes: dict[str, dict[str, str] | None]
remote_components: set[Literal["ejs:npm", "ejs:github"]]
encoding: str | None
extract_flat: bool | Literal["in_playlist", "discard", "discard_in_playlist"] | None
live_from_start: bool | None
Expand Down
13 changes: 12 additions & 1 deletion stubs/yt-dlp/yt_dlp/globals.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
from collections import defaultdict
from typing import Any, Generic, Literal, TypeVar
from typing import Any, Generic, Literal, TypedDict, TypeVar, type_check_only

from yt_dlp.utils._jsruntime import BunJsRuntime, DenoJsRuntime, NodeJsRuntime, QuickJsRuntime

@type_check_only
class _SupportedJSRuntimes(TypedDict):
deno: type[DenoJsRuntime]
node: type[NodeJsRuntime]
bun: type[BunJsRuntime]
quickjs: type[QuickJsRuntime]

_T = TypeVar("_T")

Expand All @@ -18,3 +27,5 @@ plugin_ies_overrides: Indirect[defaultdict[str, Any]]
IN_CLI: Indirect[bool]
LAZY_EXTRACTORS: Indirect[bool | None]
WINDOWS_VT_MODE: Indirect[Literal[False] | None] # Code takes into account that only False here
supported_js_runtimes: Indirect[_SupportedJSRuntimes]
supported_remote_components: Indirect[list[Literal["ejs:github", "ejs:npm"]]]
38 changes: 38 additions & 0 deletions stubs/yt-dlp/yt_dlp/utils/_jsruntime.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import abc
from dataclasses import dataclass
from functools import cached_property
from typing import Final

@dataclass(frozen=True)
class JsRuntimeInfo:
name: str
path: str
version: str
version_tuple: tuple[int, ...]
supported: bool = True

class JsRuntime(abc.ABC):
def __init__(self, path: str | None = None) -> None: ...
@cached_property
@abc.abstractmethod
def info(self) -> JsRuntimeInfo | None: ...

class DenoJsRuntime(JsRuntime):
MIN_SUPPORTED_VERSION: Final = (2, 0, 0)
@cached_property
def info(self) -> JsRuntimeInfo | None: ...

class BunJsRuntime(JsRuntime):
MIN_SUPPORTED_VERSION: Final = (1, 0, 31)
@cached_property
def info(self) -> JsRuntimeInfo | None: ...

class NodeJsRuntime(JsRuntime):
MIN_SUPPORTED_VERSION: Final = (20, 0, 0)
@cached_property
def info(self) -> JsRuntimeInfo | None: ...

class QuickJsRuntime(JsRuntime):
MIN_SUPPORTED_VERSION: Final = (2023, 12, 9)
@cached_property
def info(self) -> JsRuntimeInfo | None: ...