From 4a72e140f264086f2497bd1d7d5bec597601826a Mon Sep 17 00:00:00 2001 From: yasirarism <55983182+yasirarism@users.noreply.github.com> Date: Mon, 29 May 2023 02:34:36 +0000 Subject: [PATCH] Fix ocr and melong domain --- misskaty/__init__.py | 2 +- misskaty/plugins/media_extractor.py | 2 +- misskaty/plugins/ocr.py | 2 +- misskaty/plugins/web_scraper.py | 4 +++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/misskaty/__init__.py b/misskaty/__init__.py index ae0ca3be..b7ce33ba 100644 --- a/misskaty/__init__.py +++ b/misskaty/__init__.py @@ -28,7 +28,7 @@ MOD_NOLOAD = ["subscene_dl"] HELPABLE = {} cleanmode = {} botStartTime = time.time() -misskaty_version = "v2.023.5.16 - Stable" +misskaty_version = "v2.023.5.29 - Stable" pymonclient = MongoClient(DATABASE_URI) diff --git a/misskaty/plugins/media_extractor.py b/misskaty/plugins/media_extractor.py index 37eadee4..7a528b91 100644 --- a/misskaty/plugins/media_extractor.py +++ b/misskaty/plugins/media_extractor.py @@ -119,7 +119,7 @@ async def ceksub(self: Client, ctx: Message, strings): @use_chat_lang() async def convertsrt(self: Client, ctx: Message, strings): reply = ctx.reply_to_message - if not reply and not reply.document and not (reply.document.file_name.endswith(".vtt") or reply.document.file_name.endswith(".ass")): + if not reply or not reply.document and not (reply.document.file_name.endswith(".vtt") or reply.document.file_name.endswith(".ass")): return await ctx.reply_msg(strings("conv_sub_help").format(cmd=ctx.command[0]), del_in=5) msg = await ctx.reply_msg(strings("convert_str"), quote=True) if not os.path.exists("downloads"): diff --git a/misskaty/plugins/ocr.py b/misskaty/plugins/ocr.py index 7eafc9b6..4b0ee175 100644 --- a/misskaty/plugins/ocr.py +++ b/misskaty/plugins/ocr.py @@ -30,7 +30,7 @@ __HELP__ = "/ocr [reply to photo] - Read Text From Image" @use_chat_lang() async def ocr(self: Client, ctx: Message, strings): reply = ctx.reply_to_message - if not reply or not reply.photo or not (reply.document and reply.document.mime_type.startswith("image")) or not reply.sticker: + if not reply or not (reply.document and reply.document.mime_type.startswith("image")) or not reply.sticker: return await ctx.reply_msg(strings("no_photo").format(cmd=ctx.command[0]), quote=True, del_in=6) msg = await ctx.reply_msg(strings("read_ocr"), quote=True) try: diff --git a/misskaty/plugins/web_scraper.py b/misskaty/plugins/web_scraper.py index bd6cb5aa..51892bba 100644 --- a/misskaty/plugins/web_scraper.py +++ b/misskaty/plugins/web_scraper.py @@ -8,6 +8,7 @@ import re import logging import traceback import cloudscraper +from database import dbname from bs4 import BeautifulSoup from pykeyboard import InlineKeyboard, InlineButton from pyrogram import filters, Client @@ -39,12 +40,13 @@ headers = {"User-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/ LOGGER = logging.getLogger(__name__) SCRAP_DICT = {} data_kuso = {} +webdb = dbname.web web = { "yasirapi": "https://yasirapi.eu.org", "pahe": "https://pahe.li", "savefilm21": "https://savefilm21.store", - "melongmovie": "http://146.190.193.128", + "melongmovie": "https://melongmovie.site", "terbit21": "https://terbit21.art", "lk21": "https://nonton.lk21official.wiki", "gomov": "https://gomov.bio",