Skip to content

Commit

Permalink
Fix transcoder failing with long file names
Browse files Browse the repository at this point in the history
  • Loading branch information
wthueb committed Jun 27, 2024
1 parent 5b98935 commit 6151b11
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion wi1_bot/transcoder/transcoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,25 @@ def _do_transcode(self, item: TranscodeItem) -> bool:
status = proc.wait()

if status != 0:
transcode_to.unlink(missing_ok=True)
try:
transcode_to.unlink(missing_ok=True)
except Exception:
self.logger.warning(
f"failed to delete transcoded file: {transcode_to}"
)

if "Error opening input files" in last_output:
self.logger.info(
f"file does not exist: {path}, skipping transcoding"
)
return True

if "File name too long" in last_output:
self.logger.info(
f"file name is too long: {path}, skipping transcoding"
)
return True

if "received signal 15" in last_output:
self.logger.info(
f"transcoding interrupted by signal: {path}, will retry"
Expand Down

0 comments on commit 6151b11

Please sign in to comment.