From ce82b5ee6d35352db43ab4822da16f74295c90c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20Ayd=C4=B1n?= Date: Mon, 16 Nov 2026 16:48:15 +0300 Subject: [PATCH] [yt-dlp] Parsing helpers return None for missing or invalid input Co-Authored-By: Claude Opus 5.5 --- stubs/yt-dlp/yt_dlp/utils/_utils.pyi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/stubs/yt-dlp/yt_dlp/utils/_utils.pyi b/stubs/yt-dlp/yt_dlp/utils/_utils.pyi index 6a4c6c1ad708..e9016a3e3863 100644 --- a/stubs/yt-dlp/yt_dlp/utils/_utils.pyi +++ b/stubs/yt-dlp/yt_dlp/utils/_utils.pyi @@ -274,10 +274,10 @@ class UnsafeExecExpansionError(YoutubeDLError): ... def is_path_like(f: Any) -> bool: ... # Type checker. def extract_timezone(date_str: str, default: Any = None) -> tuple[timedelta, str]: ... # Any or type[NO_DEFAULT] -def parse_iso8601(date_str: str, delimiter: str = "T", timezone: type[NO_DEFAULT] | Any | None = None) -> int: ... +def parse_iso8601(date_str: str | None, delimiter: str = "T", timezone: type[NO_DEFAULT] | Any | None = None) -> int | None: ... def date_formats(day_first: bool = True) -> list[str]: ... -def unified_strdate(date_str: str, day_first: bool = True) -> str: ... -def unified_timestamp(date_str: str, day_first: bool = True, tz_offset: float = 0) -> int: ... +def unified_strdate(date_str: str | None, day_first: bool = True) -> str | None: ... +def unified_timestamp(date_str: str | None, day_first: bool = True, tz_offset: float = 0) -> int | None: ... def determine_ext(url: str, default_ext: str = "unknown_video") -> str: ... def subtitles_filename(filename: str, sub_lang: str, sub_format: str, expected_real_ext: str | None = None) -> str: ... def datetime_from_str(date_str: str, precision: str = "auto", format: str = "%Y%m%d") -> datetime: ... @@ -333,7 +333,7 @@ def parse_bytes(s: str) -> int: ... def parse_filesize(s: str | None) -> int | None: ... def parse_count(s: str | None) -> str | None: ... def parse_resolution(s: str, *, lenient: bool = False, parse_fps: bool = False) -> dict[str, int]: ... -def parse_bitrate(s: str) -> int: ... +def parse_bitrate(s: str | None) -> int | None: ... def month_by_name(name: str, lang: str = "en") -> str | None: ... def month_by_abbreviation(abbrev: str) -> str | None: ... def fix_xml_ampersands(xml_str: str) -> str: ... @@ -344,7 +344,7 @@ def remove_quotes(s: str) -> str: ... def get_domain(url: str) -> str | None: ... def url_basename(url: str) -> str: ... def base_url(url: str) -> str: ... -def urljoin(base: str, path: str) -> str: ... +def urljoin(base: str | None, path: str | None) -> str | None: ... def int_or_none( v: Any, scale: int = 1, default: int | None = None, get_attr: str | None = None, invscale: int = 1, base: int | None = None ) -> int | None: ... @@ -355,7 +355,7 @@ def bool_or_none(v: Any, default: bool | None = None) -> bool | None: ... def strip_or_none(v: Any, default: str | None = None) -> str | None: ... def url_or_none(url: Any) -> str | None: ... def strftime_or_none(timestamp: int, date_format: str = "%Y%m%d", default: str | None = None) -> str | None: ... -def parse_duration(s: str | None) -> float: ... +def parse_duration(s: str | None) -> float | None: ... def prepend_extension(filename: str, ext: str, expected_real_ext: str | None = None) -> str: ... def replace_extension(filename: str, ext: str, expected_real_ext: str | None = None) -> str: ... def check_executable(exe: str, args: Iterable[str] = []) -> str | None: ...