Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kaif-00z committed Aug 26, 2024
2 parents a46a28d + 747af9e commit 6b0a022
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 0 additions & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# if you are using this following code then don't forgot to give proper
# credit to t.me/kAiF_00z (github.com/kaif-00z)

import re
from traceback import format_exc

from telethon import Button, events
Expand Down
4 changes: 3 additions & 1 deletion core/executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ async def execute(self):
return False, out
else:
_log_msg = await self.reporter.started_compressing()
succ, _new_msg = await self.tools.compress(self.input_file, self.output_file, _log_msg)
succ, _new_msg = await self.tools.compress(
self.input_file, self.output_file, _log_msg
)
if not succ:
return False, _new_msg
self.reporter.msg = _new_msg
Expand Down
12 changes: 6 additions & 6 deletions functions/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
# if you are using this following code then don't forgot to give proper
# credit to t.me/kAiF_00z (github.com/kaif-00z)

import asyncio, time, re, math
import asyncio
import json
import math
import os
import re
import subprocess
from pathlib import Path
import time
from traceback import format_exc

import aiofiles
Expand Down Expand Up @@ -191,13 +193,11 @@ async def bash_(cmd, run_code=0):
err = stderr.decode().strip() or None
out = stdout.decode().strip()
if not run_code and err:
if match := re.match("\/bin\/sh: (.*): ?(\w+): not found", err):
if match := re.match("\\/bin\\/sh: (.*): ?(\\w+): not found", err):
return out, f"{match.group(2).upper()}_NOT_FOUND"
return out, err

_x, _y = await bash_(
f'mediainfo --fullscan """{dl}""" | grep "Frame count"'
)
_x, _y = await bash_(f'mediainfo --fullscan """{dl}""" | grep "Frame count"')
if _y and _y.endswith("NOT_FOUND"):
LOGS.error(f"ERROR: `{_y}`")
return False
Expand Down

0 comments on commit 6b0a022

Please sign in to comment.