Compare commits

...

3 Commits

Author SHA1 Message Date
bashonly
98e42eb044 [ie/youtube] Drop support for bun<1.2.11 and bun>1.3.14 (#16786)
Closes #16766
Authored by: bashonly
2026-05-24 23:07:42 +00:00
bashonly
b536d72c86 [ie/youtube] Drop support for node<22 (#16787)
Closes #16765
Authored by: bashonly
2026-05-24 22:56:27 +00:00
bashonly
e534a32619 [ie/youtube] Drop support for deno<2.3.0 (#16788)
Closes #16767
Authored by: bashonly
2026-05-24 22:49:00 +00:00
6 changed files with 26 additions and 12 deletions

View File

@@ -50,17 +50,16 @@ jobs:
- name: Install Deno
uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4
with:
deno-version: '2.0.0' # minimum supported version
deno-version: '2.3.0' # minimum supported version
- name: Install Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
# minimum supported version is 1.0.31 but earliest available Windows version is 1.1.0
bun-version: ${{ (matrix.os == 'windows-latest' && '1.1.0') || '1.0.31' }}
bun-version: '1.2.11' # minimum supported version
no-cache: true
- name: Install Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '20.0' # minimum supported version
node-version: '22.0' # minimum supported version
- name: Install QuickJS (Linux)
if: matrix.os == 'ubuntu-latest'
shell: bash

View File

@@ -45,7 +45,7 @@ class MockLogger:
def debug(self, message: str, *, once=False):
print(f'debug: {message}')
def info(self, message: str):
def info(self, message: str, *, once=False):
print(f'info: {message}')
def warning(self, message: str, *, once=False):

View File

@@ -45,6 +45,8 @@ class BunJCP(EJSBaseJCP, BuiltinIEContentProvider):
JS_RUNTIME_NAME = 'bun'
BUN_NPM_LIB_FILENAME = 'yt.solver.bun.lib.js'
SUPPORTED_PROXY_SCHEMES = ['http', 'https']
_BUN_MAX_SUPPORTED_VERSION = (1, 3, 14)
_BUN_DEPRECATION_URL = 'https://github.com/yt-dlp/yt-dlp/issues/16766'
def _iter_script_sources(self):
yield from super()._iter_script_sources()
@@ -112,6 +114,19 @@ class BunJCP(EJSBaseJCP, BuiltinIEContentProvider):
return options
def _run_js_runtime(self, stdin: str, /) -> str:
is_unsupported_version = self.runtime_info.version_tuple > self._BUN_MAX_SUPPORTED_VERSION
if is_unsupported_version:
self.logger.warning(
f'bun version {".".join(map(str, self.runtime_info.version_tuple))} is not supported! '
f'{".".join(map(str, self._BUN_MAX_SUPPORTED_VERSION))} is the last supported bun version. '
f'{self.ie._downloader._format_err("DO NOT", self.ie._downloader.Styles.ERROR)} '
f'open a bug report even if you encounter any errors!',
once=True)
else:
self.logger.info(
f'bun support has been deprecated. See {self._BUN_DEPRECATION_URL} for details',
once=True)
# https://bun.com/docs/cli/run
options = ['--no-addons', '--prefer-offline']
if self._lib_script.variant == ScriptVariant.BUN_NPM:
@@ -136,7 +151,7 @@ class BunJCP(EJSBaseJCP, BuiltinIEContentProvider):
msg = f'Error running bun process (returncode: {proc.returncode})'
if stderr:
msg = f'{msg}: {stderr.strip()}'
raise JsChallengeProviderError(msg)
raise JsChallengeProviderError(msg, expected=is_unsupported_version)
return stdout
def _clean_stderr(self, stderr):

View File

@@ -64,9 +64,9 @@ class YoutubeIEContentProviderLogger(IEContentProviderLogger):
if self.log_level <= self.LogLevel.DEBUG:
self.__ie.write_debug(self._format_msg(message), only_once=once)
def info(self, message: str):
def info(self, message: str, *, once=False):
if self.log_level <= self.LogLevel.INFO:
self.__ie.to_screen(self._format_msg(message))
self.__ie.to_screen(self._format_msg(message), only_once=once)
def warning(self, message: str, *, once=False):
if self.log_level <= self.LogLevel.WARNING:

View File

@@ -40,7 +40,7 @@ class IEContentProviderLogger(abc.ABC):
pass
@abc.abstractmethod
def info(self, message: str):
def info(self, message: str, *, once=False):
pass
@abc.abstractmethod

View File

@@ -87,7 +87,7 @@ class JsRuntime(abc.ABC):
class DenoJsRuntime(JsRuntime):
MIN_SUPPORTED_VERSION = (2, 0, 0)
MIN_SUPPORTED_VERSION = (2, 3, 0)
def _info(self):
path = _determine_runtime_path(self._path, 'deno')
@@ -102,7 +102,7 @@ class DenoJsRuntime(JsRuntime):
class BunJsRuntime(JsRuntime):
MIN_SUPPORTED_VERSION = (1, 0, 31)
MIN_SUPPORTED_VERSION = (1, 2, 11)
def _info(self):
path = _determine_runtime_path(self._path, 'bun')
@@ -117,7 +117,7 @@ class BunJsRuntime(JsRuntime):
class NodeJsRuntime(JsRuntime):
MIN_SUPPORTED_VERSION = (20, 0, 0)
MIN_SUPPORTED_VERSION = (22, 0, 0)
def _info(self):
path = _determine_runtime_path(self._path, 'node')