From bcdb352ccacf2bf603bbacc2f36d4ab17b8f1f8b Mon Sep 17 00:00:00 2001 From: exostring Date: Fri, 14 Aug 2026 19:59:33 +0500 Subject: [PATCH] Fix yt-dlp file creation and clean video pipeline --- src/media_processor.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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