Change channel country to be optional

This commit is contained in:
BreadTube 2025-10-30 00:00:09 +09:00
commit 45eac39d30

View file

@ -87,7 +87,7 @@ class ChannelSnippet(_Api):
customUrl: str
publishedAt: datetime
thumbnails: Thumbnails
country: str
country: str | None
@staticmethod
def from_dict(info: dict) -> ChannelSnippet:
@ -97,7 +97,7 @@ class ChannelSnippet(_Api):
customUrl=info['customUrl'],
publishedAt=datetime.fromisoformat(info['publishedAt']),
thumbnails=Thumbnails.from_dict(info['thumbnails']),
country=info['country'])
country=info.get('country'))
@dataclass