From 22af8cbeeeef7991778508eebbf8dd0098818452 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 05:02:26 +0000 Subject: [PATCH 01/12] Bump python-dateutil from 2.8.2 to 2.9.0.post0 Bumps [python-dateutil](https://github.com/dateutil/dateutil) from 2.8.2 to 2.9.0.post0. - [Release notes](https://github.com/dateutil/dateutil/releases) - [Changelog](https://github.com/dateutil/dateutil/blob/master/NEWS) - [Commits](https://github.com/dateutil/dateutil/compare/2.8.2...2.9.0.post0) --- updated-dependencies: - dependency-name: python-dateutil dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index af2a00ad..b63f4388 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,7 +19,7 @@ pyaes==1.6.1 pymongo==4.6.3 git+https://github.com/KurimuzonAkuma/pyrogram.git@v2.1.32 pysocks==1.7.1 -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 pytube==15.0.0 pytz==2024.1 pyyaml==6.0.2 From 51406da711ec167a55c3df8960f8294f8a237da7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 05:02:30 +0000 Subject: [PATCH 02/12] Bump ujson from 5.8.0 to 5.10.0 Bumps [ujson](https://github.com/ultrajson/ultrajson) from 5.8.0 to 5.10.0. - [Release notes](https://github.com/ultrajson/ultrajson/releases) - [Commits](https://github.com/ultrajson/ultrajson/compare/5.8.0...5.10.0) --- updated-dependencies: - dependency-name: ujson dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index af2a00ad..e7ca4c03 100644 --- a/requirements.txt +++ b/requirements.txt @@ -34,7 +34,7 @@ soupsieve==2.4 tgcrypto==1.2.5 tswift==0.7.0 typing-extensions -ujson==5.8.0 +ujson==5.10.0 Unidecode wikipedia==1.4.0 youtube-search-python==1.6.6 From 4996377235ec0f9b3a2862ad2e22d49e92952fd2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 05:02:33 +0000 Subject: [PATCH 03/12] Bump aiofiles from 23.2.1 to 24.1.0 Bumps [aiofiles](https://github.com/Tinche/aiofiles) from 23.2.1 to 24.1.0. - [Release notes](https://github.com/Tinche/aiofiles/releases) - [Commits](https://github.com/Tinche/aiofiles/compare/v23.2.1...v24.1.0) --- updated-dependencies: - dependency-name: aiofiles dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index af2a00ad..a304ca70 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -aiofiles==23.2.1 +aiofiles==24.1.0 apscheduler==3.10.4 asyncio==3.4.3 beautifulsoup4==4.12.3 From 17bd6c638180d3c2fd6b70a3213d1e89f9278990 Mon Sep 17 00:00:00 2001 From: "Captain D. Ezio" Date: Fri, 20 Dec 2024 22:09:21 +0530 Subject: [PATCH 04/12] Idk why --- Procfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Procfile b/Procfile index 4a873cbe..3bc15d0c 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -worker: pip install --upgrade pip setuptools wheel && pip install -r requirements.txt && python3 -m Powers \ No newline at end of file +worker: python3 -m Powers From 5ca05e426cbdc3e087849c2a934bdbad1ebe83be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C9=B4=E1=B4=8F=E1=B4=8F=CA=99=20-=20=E1=B4=8D=E1=B4=9C?= =?UTF-8?q?=E1=B4=8B=E1=B4=87s=CA=9C?= <108251605+Noob-mukesh@users.noreply.github.com> Date: Sat, 28 Dec 2024 15:05:16 +0530 Subject: [PATCH 05/12] fixed locktype issue --- Powers/database/locks_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Powers/database/locks_db.py b/Powers/database/locks_db.py index c4a9fc7b..fac4bdf7 100644 --- a/Powers/database/locks_db.py +++ b/Powers/database/locks_db.py @@ -92,7 +92,7 @@ def get_lock_channel(self, chat: int, locktype: str = "all"): to_return["anti_fwd"]["user"] = True elif i["locktype"] == "anti_fwd_c": to_return["anti_fwd"]["chat"] = True - elif i["anti_links"] == "anti_links": + elif i["locktype"] == "anti_links": to_return["anti_links"] = True elif i["locktype"] == "bot": to_return["bot"] = True From 35341bb89057a89c0e4d71a4a31fd58c7be83dcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C9=B4=E1=B4=8F=E1=B4=8F=CA=99=20-=20=E1=B4=8D=E1=B4=9C?= =?UTF-8?q?=E1=B4=8B=E1=B4=87s=CA=9C?= <108251605+Noob-mukesh@users.noreply.github.com> Date: Sat, 28 Dec 2024 15:59:37 +0530 Subject: [PATCH 06/12] fixed locks type not giving results --- Powers/plugins/locks.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Powers/plugins/locks.py b/Powers/plugins/locks.py index b993c417..97b4a085 100644 --- a/Powers/plugins/locks.py +++ b/Powers/plugins/locks.py @@ -254,6 +254,7 @@ async def convert_to_emoji(val: bool): Can send links: {vantil} Can bot send messages: {vantibot} """ + await chkmsg.edit_text(permission_view_str) except RPCError as e_f: await chkmsg.edit_text(text="Something went wrong!") await m.reply_text(e_f) From 7cd3d62651e632b638bc9c3244c135aea250187f Mon Sep 17 00:00:00 2001 From: "Captain D. Ezio" Date: Sat, 28 Dec 2024 22:25:10 +0530 Subject: [PATCH 07/12] Update stickers.py --- Powers/plugins/stickers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Powers/plugins/stickers.py b/Powers/plugins/stickers.py index c08c1652..2c362961 100644 --- a/Powers/plugins/stickers.py +++ b/Powers/plugins/stickers.py @@ -276,7 +276,7 @@ async def memify_it(c: Gojo, m: Message): kb = IKM( [ [ - IKB("Join for memes", url="https://t.me/memesofdank") + IKB("You might like", url="https://t.me/me_and_ghost") ] ] ) From 12518c0312ce88f34a9ff2c80fc6fbd4716b83bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C9=B4=E1=B4=8F=E1=B4=8F=CA=99=20-=20=E1=B4=8D=E1=B4=9C?= =?UTF-8?q?=E1=B4=8B=E1=B4=87s=CA=9C?= <108251605+Noob-mukesh@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:27:22 +0530 Subject: [PATCH 08/12] Update stickers.py --- Powers/plugins/stickers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Powers/plugins/stickers.py b/Powers/plugins/stickers.py index 2c362961..b77fc526 100644 --- a/Powers/plugins/stickers.py +++ b/Powers/plugins/stickers.py @@ -331,7 +331,7 @@ async def get_sticker_from_file(c: Gojo, m: Message): if repl.sticker: if repl.sticker.is_animated: upp = await repl.download() - up = tgs_to_gif(upp, True) + up = await tgs_to_gif(upp, True) await x.delete() await m.reply_animation(up, caption=Caption) elif repl.sticker.is_video: From 2a369bf7981556d7b6c4e6f395162c244098d56d Mon Sep 17 00:00:00 2001 From: Captain Ezio Date: Sun, 29 Dec 2024 14:01:01 +0530 Subject: [PATCH 09/12] few fixes --- Powers/plugins/web_con.py | 1 + Powers/utils/web_helpers.py | 7 +++++-- Powers/utils/web_scrapper.py | 4 +++- requirements.txt | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Powers/plugins/web_con.py b/Powers/plugins/web_con.py index 8b8ed189..b255c41a 100644 --- a/Powers/plugins/web_con.py +++ b/Powers/plugins/web_con.py @@ -304,6 +304,7 @@ async def download_instareels(c: Gojo, m: Message): content = insta.get_media() if content["code"] == 69 or content["message"] != "success": + await to_edit.delete() return await m.reply_text(content["message"]) try: diff --git a/Powers/utils/web_helpers.py b/Powers/utils/web_helpers.py index ad7fa126..194affe6 100644 --- a/Powers/utils/web_helpers.py +++ b/Powers/utils/web_helpers.py @@ -140,7 +140,7 @@ async def song_search(query, max_results=1): except Exception as e: LOGGER.error(e) LOGGER.error(format_exc()) - return yt_dict + return {0: e} nums = 1 for i in results["result"]: durr = i['duration'].split(":") @@ -169,7 +169,7 @@ async def song_search(query, max_results=1): thumb = {"thumbnail": i["thumbnails"][0]["url"]} except Exception: thumb = {"thumbnail": None} - dict_form |= thumb + dict_form.update(thumb) yt_dict[nums] = dict_form nums += 1 return yt_dict @@ -226,6 +226,9 @@ async def youtube_downloader(c: Gojo, m: Message, query: str, type_: str): ext = "mp4" # ydl = yt_dlp.YoutubeDL(opts) dicti = await song_search(query, 1) + if err := dicti.get(0, None): + await m.reply_text(err) + return if not dicti and type(dicti) != str: await m.reply_text("File with duration less than or equals to 10 minutes is allowed only") elif type(dicti) == str: diff --git a/Powers/utils/web_scrapper.py b/Powers/utils/web_scrapper.py index b5ba56d5..387e987b 100644 --- a/Powers/utils/web_scrapper.py +++ b/Powers/utils/web_scrapper.py @@ -6,7 +6,6 @@ from Powers import * - # import requests # from selenium import webdriver # from selenium.webdriver.chrome.options import Options @@ -211,6 +210,7 @@ def get_videos(self) -> list: # else: # return {} +timeout = httpx.Timeout(20) class INSTAGRAM: def __init__(self, url): @@ -224,6 +224,8 @@ def get_media(self): return httpx.post( f"https://api.qewertyy.dev/downloaders/instagram?url={self.url}" ).json() + except httpx.ReadTimeout: + return self.get_media(self.url) except Exception as e: LOGGER.error(e) LOGGER.error(format_exc()) diff --git a/requirements.txt b/requirements.txt index af2a00ad..a115077d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,6 +12,7 @@ gpytranslate==1.5.1 httpx lyricsgenius==3.0.1 pillow == 10.3.0 +lottie==0.7.1 lxml==4.9.1 pillow == 10.3.0 prettyconf==2.2.1 From e3fb9884737acc9a6201011a441739795af2ce67 Mon Sep 17 00:00:00 2001 From: Captain Ezio Date: Sun, 29 Dec 2024 14:42:05 +0530 Subject: [PATCH 10/12] few fixes --- Powers/plugins/dev.py | 1 + Powers/plugins/info.py | 9 ++++----- Powers/utils/web_scrapper.py | 23 +++++++++++++++++++---- requirements.txt | 4 ++-- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/Powers/plugins/dev.py b/Powers/plugins/dev.py index 536a95c2..1da043df 100644 --- a/Powers/plugins/dev.py +++ b/Powers/plugins/dev.py @@ -720,6 +720,7 @@ async def forward_type_broadcast(c: Gojo, m: Message): • /neofetch : Fetch neo. • /eval : Evaluate the given python code. • /exec : Execute the given code. +• /minfo [module name]: Give info about module • /chatlist : Return the list of chats present in database • /uptime : Return the uptime of the bot. • /leavechat : Bot will leave the provided chat. diff --git a/Powers/plugins/info.py b/Powers/plugins/info.py index 3a546491..095c87ab 100644 --- a/Powers/plugins/info.py +++ b/Powers/plugins/info.py @@ -241,12 +241,11 @@ async def info_func(c: Gojo, message: Message): return try: user, _, user_name = await extract_user(c, message) - except Exception: - await message.reply_text("Got Some errors failed to fetch user info") + except Exception as e: + await message.reply_text(f"Got Some errors failed to fetch user info\n{e}") LOGGER.error(e) - LOGGER.error(format_exc) - if not user: - await message.reply_text("Can't find user to fetch info!") + LOGGER.error(format_exc()) + return m = await message.reply_text( f"Fetching {f'@{user_name}' if user_name else 'user'} info from telegram's database..." diff --git a/Powers/utils/web_scrapper.py b/Powers/utils/web_scrapper.py index 387e987b..29ff3fa5 100644 --- a/Powers/utils/web_scrapper.py +++ b/Powers/utils/web_scrapper.py @@ -209,8 +209,8 @@ def get_videos(self) -> list: # else: # return {} - -timeout = httpx.Timeout(20) +curr_timeout = 20 +timeout = httpx.Timeout(curr_timeout) class INSTAGRAM: def __init__(self, url): @@ -220,12 +220,27 @@ def is_correct_url(self): return bool((re.compile(r"^https?://(?:www\.)?instagram\.com/")).match(self.url)) def get_media(self): + global curr_timeout try: return httpx.post( - f"https://api.qewertyy.dev/downloaders/instagram?url={self.url}" + f"https://api.qewertyy.dev/downloaders/instagram?url={self.url}", + timeout=timeout ).json() except httpx.ReadTimeout: - return self.get_media(self.url) + try: + curr_timeout += 10 + timeout = httpx.Timeout(curr_timeout) + return httpx.post( + f"https://api.qewertyy.dev/downloaders/instagram?url={self.url}", + timeout=timeout + ).json() + except httpx.ReadTimeout: + return {"code": 69, "message": "Please retry after few seconds"} + except Exception as e: + LOGGER.error(e) + LOGGER.error(format_exc()) + return {"code": 69, "message": e} + except Exception as e: LOGGER.error(e) LOGGER.error(format_exc()) diff --git a/requirements.txt b/requirements.txt index a115077d..092a7d28 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ charset-normalizer==3.4.0 dnspython==2.6.1 google==3.0.0 gpytranslate==1.5.1 -httpx +httpx==0.27.2 lyricsgenius==3.0.1 pillow == 10.3.0 lottie==0.7.1 @@ -18,7 +18,7 @@ pillow == 10.3.0 prettyconf==2.2.1 pyaes==1.6.1 pymongo==4.6.3 -git+https://github.com/KurimuzonAkuma/pyrogram.git@v2.1.32 +git+https://github.com/KurimuzonAkuma/pyrogram.git@v2.1.34 pysocks==1.7.1 python-dateutil==2.8.2 pytube==15.0.0 From b24317d71320a33089e8f68b1f31bc41628a2e88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 29 Dec 2024 09:14:00 +0000 Subject: [PATCH 11/12] Bump certifi from 2024.7.4 to 2024.12.14 Bumps [certifi](https://github.com/certifi/python-certifi) from 2024.7.4 to 2024.12.14. - [Commits](https://github.com/certifi/python-certifi/compare/2024.07.04...2024.12.14) --- updated-dependencies: - dependency-name: certifi dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 092a7d28..67c3c7ae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ asyncio==3.4.3 beautifulsoup4==4.12.3 cachetools==5.2.0 captcha==0.6.0 -certifi==2024.7.4 +certifi==2024.12.14 charset-normalizer==3.4.0 dnspython==2.6.1 google==3.0.0 From 4cc94855ed04684a6106a32cea2843b4007d1d33 Mon Sep 17 00:00:00 2001 From: iamgojoof6eyes <91426868+iamgojoof6eyes@users.noreply.github.com> Date: Mon, 30 Dec 2024 01:25:58 +0000 Subject: [PATCH 12/12] Auto-update pre-commit hooks --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c94957c1..2f2153a8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v3.19.0 + rev: v3.19.1 hooks: - id: pyupgrade args: [--py36-plus]