address some dependabot issues

This commit is contained in:
Abhi
2025-05-13 03:07:25 +05:30
parent 9fea7794e0
commit 9ac09ee101
6 changed files with 16 additions and 24 deletions

View File

@@ -134,7 +134,9 @@ async def main():
raise
except (errors.NotAcceptable, errors.Unauthorized) as e:
logging.error(
f"{e.__class__.__name__}: {e}\nMoving session file to my_account.session-old..."
"%s: %s\nMoving session file to my_account.session-old...",
e.__class__.__name__,
e,
)
os.rename("./my_account.session", "./my_account.session-old")
restart()

View File

@@ -15,7 +15,7 @@
#  along with this program.  If not, see <https://www.gnu.org/licenses/>.
from pyrogram import Client, enums, filters
from pyrogram.types import Message, MessageOriginHiddenUser, MessageOriginUser
from pyrogram.types import Message, MessageOriginHiddenUser
from utils.misc import modules_help, prefix
@@ -71,7 +71,6 @@ async def ids(_, message: Message):
]
)
elif ffc := rtm.forward_origin.sender_user:
# print(rtm.forward_origin)
text = "\n".join(
[
text,

View File

@@ -61,7 +61,9 @@ async def convert_to_image(message, client) -> None | str:
elif message.reply_to_message.video or message.reply_to_message.animation:
final_path = "fetched_thumb.png"
vid_path = await client.download_media(message.reply_to_message)
await exec(f"ffmpeg -i {vid_path} -filter:v scale=500:500 -an {final_path}") # skipcq
await exec(
f"ffmpeg -i {vid_path} -filter:v scale=500:500 -an {final_path}"
) # skipcq
elif message.reply_to_message.document:
if message.reply_to_message.document.mime_type == "image/jpeg":
final_path = await message.reply_to_message.download()
@@ -78,9 +80,11 @@ async def convert_to_image(message, client) -> None | str:
def remove_background(photo_data):
with open(photo_data, "rb") as image_file:
image_data = image_file.read()
response = requests.post(
"https://api.remove.bg/v1.0/removebg",
files={"image_file": open(photo_data, "rb")},
files={"image_file": image_data},
data={"size": "auto"},
headers={"X-Api-Key": rmbg_key},
)

View File

@@ -139,7 +139,7 @@ async def check_new_login(client: Client, update: UpdateServiceNotification, _,
f"Logined at: <code>{logined_time}</code>\n"
f"IP: <code>{auth.ip}</code>\n"
f"Country: <code>{auth.country}</code>\n"
f'Official app: <b>{"yes" if auth.official_app else "no"}</b>\n\n'
f"Official app: <b>{'yes' if auth.official_app else 'no'}</b>\n\n"
f"<b>It is you? Type <code>{prefix}sk off</code> and try logging "
f"in again.</b>"
)

View File

@@ -367,14 +367,7 @@ def get_reply_text(reply: types.Message) -> str:
0
].id
== reply.from_user.id
else "👤 invited %s to the group"
% (
get_full_name(
reply.new_chat_members[
0
]
)
)
else f"👤 invited {get_full_name(reply.new_chat_members[0])} to the group"
)
if reply.new_chat_members
else (
@@ -382,12 +375,7 @@ def get_reply_text(reply: types.Message) -> str:
"👤 left the group"
if reply.left_chat_member.id
== reply.from_user.id
else "👤 removed %s"
% (
get_full_name(
reply.left_chat_member
)
)
else f"👤 removed {get_full_name(reply.left_chat_member)}"
)
if reply.left_chat_member
else (

View File

@@ -78,7 +78,6 @@ async def urldl(client: Client, message: Message):
await message.edit("<b>Trying to download...</b>")
ext = "." + link.split(".")[-1]
c_time = time.time()
resp = requests.head(link, allow_redirects=True, timeout=5)