Fix yt-dlp file creation and clean video pipeline
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user