From 703498f0a5dcb92b8b7c35e9bc4ff6701c226c72 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Sat, 12 Aug 2023 22:12:38 +0700 Subject: [PATCH] style: format code with black and isort (#260) Format code with black and isort This commit fixes the style issues introduced in de72f60 according to the output from Black and isort. Details: None Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> --- misskaty/plugins/web_scraper.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/misskaty/plugins/web_scraper.py b/misskaty/plugins/web_scraper.py index 96ff5333..3f150ba1 100644 --- a/misskaty/plugins/web_scraper.py +++ b/misskaty/plugins/web_scraper.py @@ -336,9 +336,15 @@ async def getDataLendrive(msg, kueri, CurrentPage, user, strings): if not SCRAP_DICT.get(msg.id): try: if query: - data = await http.get(f"{web['lendrive']}/?s={query}", headers=headers, follow_redirects=True) + data = await http.get( + f"{web['lendrive']}/?s={query}", + headers=headers, + follow_redirects=True, + ) else: - data = await http.get(web["lendrive"], headers=headers, follow_redirects=True) + data = await http.get( + web["lendrive"], headers=headers, follow_redirects=True + ) except Exception as err: await msg.edit_msg(strings("err_getweb").format(err=err)) return None, None @@ -347,9 +353,19 @@ async def getDataLendrive(msg, kueri, CurrentPage, user, strings): for o in res.find_all(class_="bsx"): title = o.find("a")["title"] link = o.find("a")["href"] - status = o.find(class_="epx").text if o.find(class_="epx") else "Not Provided by BOT" - kualitas = o.find(class_="typez TV").text if o.find(class_="typez TV") else o.find(class_="typez BD") - lenddata.append({"judul": title, "link": link, "quality": kualitas, "status": status}) + status = ( + o.find(class_="epx").text + if o.find(class_="epx") + else "Not Provided by BOT" + ) + kualitas = ( + o.find(class_="typez TV").text + if o.find(class_="typez TV") + else o.find(class_="typez BD") + ) + lenddata.append( + {"judul": title, "link": link, "quality": kualitas, "status": status} + ) if not lenddata: await msg.edit_msg(strings("no_result"), del_in=5) return None, 0, None