Change channel country to be optional
This commit is contained in:
parent
3ddffe2774
commit
45eac39d30
1 changed files with 2 additions and 2 deletions
|
|
@ -87,7 +87,7 @@ class ChannelSnippet(_Api):
|
||||||
customUrl: str
|
customUrl: str
|
||||||
publishedAt: datetime
|
publishedAt: datetime
|
||||||
thumbnails: Thumbnails
|
thumbnails: Thumbnails
|
||||||
country: str
|
country: str | None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_dict(info: dict) -> ChannelSnippet:
|
def from_dict(info: dict) -> ChannelSnippet:
|
||||||
|
|
@ -97,7 +97,7 @@ class ChannelSnippet(_Api):
|
||||||
customUrl=info['customUrl'],
|
customUrl=info['customUrl'],
|
||||||
publishedAt=datetime.fromisoformat(info['publishedAt']),
|
publishedAt=datetime.fromisoformat(info['publishedAt']),
|
||||||
thumbnails=Thumbnails.from_dict(info['thumbnails']),
|
thumbnails=Thumbnails.from_dict(info['thumbnails']),
|
||||||
country=info['country'])
|
country=info.get('country'))
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue