Skip to content

Commit

Permalink
update ffmpeg_s.py
Browse files Browse the repository at this point in the history
  • Loading branch information
5hojib committed Dec 8, 2024
1 parent 34de841 commit 4743117
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bot/helper/aeon_utils/ffmpeg_s.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ async def readlines(self, stream):

async def progress(self, status: str = ""):
start_time = time()
async for line in self.readlines(self.listener.suproc.stderr):
async for line in self.readlines(self.listener.subproc.stderr):
if (
self.is_cancel
or self.listener.suproc == "cancelled"
or self.listener.suproc.returncode is not None
or self.listener.subproc == "cancelled"
or self.listener.subproc.returncode is not None
):
return
if status == "direct":
Expand Down Expand Up @@ -174,15 +174,15 @@ async def create(self, video_file: str, on_file: bool = False):
self.outfile,
]

if self.listener.suproc == "cancelled":
if self.listener.subproc == "cancelled":
return False

self.name, self.size = (
ospath.basename(video_file),
await get_path_size(video_file),
)
self.listener.suproc = await create_subprocess_exec(*cmd, stderr=PIPE)
_, code = await gather(self.progress(), self.listener.suproc.wait())
self.listener.subproc = await create_subprocess_exec(*cmd, stderr=PIPE)
_, code = await gather(self.progress(), self.listener.subproc.wait())

if code == -9:
return False
Expand All @@ -199,7 +199,7 @@ async def create(self, video_file: str, on_file: bool = False):

LOGGER.error(
"%s. Something went wrong while creating sample video, mostly file is corrupted. Path: %s",
(await self.listener.suproc.stderr.read()).decode().strip(),
(await self.listener.subproc.stderr.read()).decode().strip(),
video_file,
)
return video_file

0 comments on commit 4743117

Please sign in to comment.