From 6ae6badf259c866bfd5c534cfc362115c61a2daa Mon Sep 17 00:00:00 2001 From: donbarbos Date: Fri, 30 Jan 2026 18:54:49 +0400 Subject: [PATCH 1/3] [yt-dlp] Update to 2026.01.29 * Closes: #15342 * Extend `_InfoDict` TypedDict based on `InfoExtractor` docstring ([see source](https://github.com/yt-dlp/yt-dlp/blob/bf5d8c2a663ac690711262aebc733c1b06a54b26/yt_dlp/extractor/common.py#L124)) --- stubs/yt-dlp/METADATA.toml | 2 +- stubs/yt-dlp/yt_dlp/extractor/common.pyi | 101 ++++++++++++++++++++--- stubs/yt-dlp/yt_dlp/utils/_utils.pyi | 2 +- 3 files changed, 91 insertions(+), 14 deletions(-) diff --git a/stubs/yt-dlp/METADATA.toml b/stubs/yt-dlp/METADATA.toml index 02ff49efc0c3..283531521334 100644 --- a/stubs/yt-dlp/METADATA.toml +++ b/stubs/yt-dlp/METADATA.toml @@ -1,3 +1,3 @@ -version = "2025.12.08" +version = "2026.01.29" upstream_repository = "https://github.com/yt-dlp/yt-dlp" requires = ["websockets"] diff --git a/stubs/yt-dlp/yt_dlp/extractor/common.pyi b/stubs/yt-dlp/yt_dlp/extractor/common.pyi index ab893d27e8e0..0ba9f652b32e 100644 --- a/stubs/yt-dlp/yt_dlp/extractor/common.pyi +++ b/stubs/yt-dlp/yt_dlp/extractor/common.pyi @@ -1,5 +1,5 @@ import re -from _typeshed import Unused +from _typeshed import Incomplete, Unused from collections.abc import Callable, Collection, Iterable, Iterator, Mapping, Sequence from functools import cached_property from json.decoder import JSONDecoder @@ -17,22 +17,99 @@ from ..YoutubeDL import YoutubeDL @type_check_only class _InfoDict(TypedDict, total=False): - age_limit: int - availability: Literal["private", "premium_only", "subscriber_only", "needs_auth", "unlisted", "public"] | None + id: Required[str] + title: str | None + formats: list[dict[str, Any]] | None available_at: int - creator: str | None - comment_count: int | None + url: str | None + ext: str | None + format: str | None + player_url: str | None + direct: bool | None + alt_title: str | None + display_id: Incomplete + thumbnails: list[dict[str, Incomplete]] | None + thumbnail: str | None + description: str | None + uploader: str | None + license: str | None + creators: list[str] | None + timestamp: int | float | None + upload_date: Incomplete + release_timestamp: Incomplete + release_date: Incomplete + release_year: Incomplete + modified_timestamp: Incomplete + modified_date: Incomplete + uploader_id: Incomplete + uploader_url: str | None + channel: str | None + channel_id: Incomplete + channel_url: str | None + channel_follower_count: int | None + channel_is_verified: Incomplete + location: Incomplete + subtitles: Incomplete + automatic_captions: Incomplete duration: int | None - formats: list[dict[str, Any]] | None - id: Required[str] + view_count: int | None + concurrent_view_count: int | None + save_count: int | None like_count: int | None + dislike_count: int | None + repost_count: int | None + average_rating: Incomplete + comment_count: int | None + comments: Incomplete + age_limit: int + webpage_url: str | None + categories: list[str] | None tags: list[str] | None - thumbnail: str | None - timestamp: int | float | None - title: str | None - uploader: str | None - url: str | None + cast: list[Incomplete] | None + is_live: bool | None + was_live: bool | None + live_status: Literal["is_live", "is_upcoming", "was_live", "not_live", "post_live"] | None + start_time: Incomplete + end_time: Incomplete + chapters: Incomplete + heatmap: Incomplete + playable_in_embed: bool | str | None + availability: Literal["private", "premium_only", "subscriber_only", "needs_auth", "unlisted", "public"] | None + media_type: str | None + _old_archive_ids: Incomplete + _format_sort_fields: Incomplete + chapter: str | None + chapter_number: int | None + chapter_id: str | None + series: str | None + series_id: str | None + season: str | None + season_number: int | None + season_id: str | None + episode: Incomplete + episode_number: int | None + episode_id: str | None + track: str | None + track_number: int | None + track_id: str | None + artists: list[str] | None + composers: list[str] | None + genres: list[str] | None + album: str | None + album_type: str | None + album_artists: list[str] | None + disc_number: int | None + section_start: Incomplete + section_end: Incomplete + rows: int | None + columns: int | None requested_formats: Iterable[_InfoDict] + # deprecated fields: + composer: Incomplete + artist: Incomplete + genre: Incomplete + album_artist: Incomplete + creator: str | None _StrNoDefaultOrNone: TypeAlias = str | None | type[NO_DEFAULT] _T = TypeVar("_T") diff --git a/stubs/yt-dlp/yt_dlp/utils/_utils.pyi b/stubs/yt-dlp/yt_dlp/utils/_utils.pyi index b883127d346a..73e25f4453da 100644 --- a/stubs/yt-dlp/yt_dlp/utils/_utils.pyi +++ b/stubs/yt-dlp/yt_dlp/utils/_utils.pyi @@ -274,7 +274,7 @@ def extract_timezone(date_str: str, default: Any = None) -> tuple[timedelta, str def parse_iso8601(date_str: str, delimiter: str = "T", timezone: type[NO_DEFAULT] | Any | None = None) -> int: ... 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) -> int: ... +def unified_timestamp(date_str: str, day_first: bool = True, tz_offset: float = 0) -> int: ... 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: ... From dade1c79cb9b5505b082a9fcdc1cb4fc7a80663a Mon Sep 17 00:00:00 2001 From: donbarbos Date: Fri, 30 Jan 2026 19:33:46 +0400 Subject: [PATCH 2/3] Add two missing fields --- stubs/yt-dlp/yt_dlp/extractor/common.pyi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stubs/yt-dlp/yt_dlp/extractor/common.pyi b/stubs/yt-dlp/yt_dlp/extractor/common.pyi index 0ba9f652b32e..08af312df757 100644 --- a/stubs/yt-dlp/yt_dlp/extractor/common.pyi +++ b/stubs/yt-dlp/yt_dlp/extractor/common.pyi @@ -8,6 +8,8 @@ from typing_extensions import Never, Required, TypeAlias, deprecated from urllib.request import Request, _DataType from xml.etree import ElementTree as ET +from yt_dlp.utils import PagedList + from ..cache import Cache from ..cookies import LenientSimpleCookie, YoutubeDLCookieJar from ..networking.common import Response, _RequestData @@ -103,6 +105,8 @@ class _InfoDict(TypedDict, total=False): section_end: Incomplete rows: int | None columns: int | None + playlist_count: int | None + entries: Iterable[_InfoDict] | PagedList | None requested_formats: Iterable[_InfoDict] # deprecated fields: composer: Incomplete From d4538d89603f0dcd300bc8e02d7a4ed50bcb0bfe Mon Sep 17 00:00:00 2001 From: donbarbos Date: Fri, 30 Jan 2026 19:46:40 +0400 Subject: [PATCH 3/3] remove None --- stubs/yt-dlp/yt_dlp/extractor/common.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/yt-dlp/yt_dlp/extractor/common.pyi b/stubs/yt-dlp/yt_dlp/extractor/common.pyi index 08af312df757..d977586c5182 100644 --- a/stubs/yt-dlp/yt_dlp/extractor/common.pyi +++ b/stubs/yt-dlp/yt_dlp/extractor/common.pyi @@ -106,7 +106,7 @@ class _InfoDict(TypedDict, total=False): rows: int | None columns: int | None playlist_count: int | None - entries: Iterable[_InfoDict] | PagedList | None + entries: Iterable[_InfoDict] | PagedList requested_formats: Iterable[_InfoDict] # deprecated fields: composer: Incomplete