66
77from async_python_youtube .const import LiveBroadcastContent
88
9+ __all__ = [
10+ "YouTubeThumbnail" ,
11+ "YouTubeVideoThumbnails" ,
12+ "YouTubeVideoSnippet" ,
13+ "YouTubeVideo" ,
14+ "YouTubeChannelThumbnails" ,
15+ "YouTubeChannelRelatedPlaylists" ,
16+ "YouTubeChannelContentDetails" ,
17+ "YouTubeChannelSnippet" ,
18+ "YouTubeChannel" ,
19+ ]
20+
921T = TypeVar ("T" )
1022
1123
12- class YouTubeVideoThumbnail (BaseModel ):
24+ class YouTubeThumbnail (BaseModel ):
1325 """Model representing a video thumbnail."""
1426
1527 url : str = Field (...)
@@ -20,11 +32,11 @@ class YouTubeVideoThumbnail(BaseModel):
2032class YouTubeVideoThumbnails (BaseModel ):
2133 """Model representing video thumbnails."""
2234
23- default : YouTubeVideoThumbnail = Field (...)
24- medium : YouTubeVideoThumbnail = Field (...)
25- high : YouTubeVideoThumbnail = Field (...)
26- standard : YouTubeVideoThumbnail = Field (...)
27- maxres : YouTubeVideoThumbnail | None = Field (None )
35+ default : YouTubeThumbnail = Field (...)
36+ medium : YouTubeThumbnail = Field (...)
37+ high : YouTubeThumbnail = Field (...)
38+ standard : YouTubeThumbnail = Field (...)
39+ maxres : YouTubeThumbnail | None = Field (None )
2840
2941
3042class YouTubeVideoSnippet (BaseModel ):
@@ -36,7 +48,7 @@ class YouTubeVideoSnippet(BaseModel):
3648 description : str = Field (...)
3749 thumbnails : YouTubeVideoThumbnails = Field (...)
3850 channel_title : str = Field (..., alias = "channelTitle" )
39- tags : list [str ] = Field (... )
51+ tags : list [str ] = Field ([] )
4052 live_broadcast_content : LiveBroadcastContent = Field (
4153 ...,
4254 alias = "liveBroadcastContent" ,
@@ -50,3 +62,48 @@ class YouTubeVideo(BaseModel):
5062
5163 video_id : str = Field (..., alias = "id" )
5264 snippet : YouTubeVideoSnippet | None = None
65+
66+
67+ class YouTubeChannelThumbnails (BaseModel ):
68+ """Model representing channel thumbnails."""
69+
70+ default : YouTubeThumbnail = Field (...)
71+ medium : YouTubeThumbnail = Field (...)
72+ high : YouTubeThumbnail = Field (...)
73+
74+
75+ class YouTubeChannelRelatedPlaylists (BaseModel ):
76+ """Model representing related playlists of a channel."""
77+
78+ likes : str = Field (...)
79+ uploads : str = Field (...)
80+
81+
82+ class YouTubeChannelContentDetails (BaseModel ):
83+ """Model representing content details of a channel."""
84+
85+ related_playlists : YouTubeChannelRelatedPlaylists = Field (
86+ ...,
87+ alias = "relatedPlaylists" ,
88+ )
89+
90+
91+ class YouTubeChannelSnippet (BaseModel ):
92+ """Model representing channel snippet."""
93+
94+ title : str = Field (...)
95+ description : str = Field (...)
96+ published_at : datetime = Field (..., alias = "publishedAt" )
97+ thumbnails : YouTubeChannelThumbnails = Field (...)
98+ default_language : str | None = Field (None , alias = "defaultLanguage" )
99+
100+
101+ class YouTubeChannel (BaseModel ):
102+ """Model representing a YouTube channel."""
103+
104+ channel_id : str = Field (..., alias = "id" )
105+ snippet : YouTubeChannelSnippet | None = None
106+ content_details : YouTubeChannelContentDetails | None = Field (
107+ None ,
108+ alias = "contentDetails" ,
109+ )
0 commit comments