From 880a85cd1019e1a7ab0f890a25ed353de1ea9c4d Mon Sep 17 00:00:00 2001 From: Shion Ichikawa Date: Mon, 22 Jan 2024 10:54:53 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20for=20#486,=20replacing=20?= =?UTF-8?q?default=20check=20logic=20for=20profile=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ghunt/parsers/people.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ghunt/parsers/people.py b/ghunt/parsers/people.py index 4f83dcea..9656033a 100644 --- a/ghunt/parsers/people.py +++ b/ghunt/parsers/people.py @@ -47,21 +47,21 @@ def _scrape(self, extended_data: Dict[str, any]): if (gplus_data := extended_data.get("gplusExtendedData")): self.gplusData._scrape(gplus_data) + class PersonPhoto(Parser): def __init__(self): self.url: str = "" self.isDefault: bool = False - self.flathash: str = None async def _scrape(self, as_client: httpx.AsyncClient, photo_data: Dict[str, any], photo_type: str): if photo_type == "profile_photo": self.url = photo_data.get("url") + if isDefault := photo_data.get("isDefault"): + self.isDefault = isDefault - self.isDefault, self.flathash = await is_default_profile_pic(as_client, self.url) - elif photo_type == "cover_photo": self.url = '='.join(photo_data.get("imageUrl").split("=")[:-1]) - if (isDefault := photo_data.get("isDefault")): + if isDefault := photo_data.get("isDefault"): self.isDefault = isDefault else: raise GHuntAPIResponseParsingError(f'The provided photo type "{photo_type}" weren\'t recognized.')