diff --git a/src/media_processor.py b/src/media_processor.py index af1661d..6e052f3 100644 --- a/src/media_processor.py +++ b/src/media_processor.py @@ -6,6 +6,7 @@ import os import sys import tempfile import time +import uuid from dataclasses import dataclass from pathlib import Path from typing import Any, Optional, Set @@ -101,12 +102,7 @@ class MediaProcessor: self, url: str, prefix: str = "video_" ) -> tuple[Optional[Path], Optional[str], bool]: """Returns (path, error_message, is_permanent_error)""" - tmp = tempfile.NamedTemporaryFile( - dir=self.cache_dir, prefix=prefix, suffix=".mp4", delete=False - ) - output_path = Path(tmp.name) - tmp.close() - + output_path = self.cache_dir / f"{prefix}{uuid.uuid4().hex[:12]}.mp4" await register_active_path(output_path) max_size = self.max_video_bytes netrc_path = None