mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 10:51:05 -05:00
FFmpeg Management:
Updated extraction logic to handle BtbN's new archive structure with binaries in the bin directory Added fallback to old structure for backward compatibility Improved binary verification and permissions handling Enhanced error handling during extraction and verification Error Handling: Added specific exception types for different errors Better error propagation through the system Improved error logging and user feedback Enhanced cleanup on errors Resource Management: Better cleanup of failed downloads Proper handling of temporary files Enhanced queue management Improved file deletion with retries Verification: FFmpeg binary verification with version checks Video file integrity verification Compression result verification Archive structure verification The system now: Properly handles FFmpeg's new archive structure Better manages binary downloads and verification Provides more detailed error messages Cleans up resources properly Shows appropriate reactions for different error types
This commit is contained in:
@@ -237,11 +237,19 @@ class FFmpegDownloader:
|
|||||||
with zipfile.ZipFile(archive_path, "r") as zip_ref:
|
with zipfile.ZipFile(archive_path, "r") as zip_ref:
|
||||||
binary_names = self._get_binary_names()
|
binary_names = self._get_binary_names()
|
||||||
for binary_name in binary_names:
|
for binary_name in binary_names:
|
||||||
|
# BtbN's builds have binaries in bin directory
|
||||||
binary_files = [
|
binary_files = [
|
||||||
f
|
f
|
||||||
for f in zip_ref.namelist()
|
for f in zip_ref.namelist()
|
||||||
if f.endswith(f"/{binary_name}") or f.endswith(f"\\{binary_name}")
|
if f.endswith(f"/bin/{binary_name}") or f.endswith(f"\\bin\\{binary_name}")
|
||||||
]
|
]
|
||||||
|
if not binary_files:
|
||||||
|
# Fallback to old structure
|
||||||
|
binary_files = [
|
||||||
|
f
|
||||||
|
for f in zip_ref.namelist()
|
||||||
|
if f.endswith(f"/{binary_name}") or f.endswith(f"\\{binary_name}")
|
||||||
|
]
|
||||||
if not binary_files:
|
if not binary_files:
|
||||||
raise DownloadError(f"{binary_name} not found in archive")
|
raise DownloadError(f"{binary_name} not found in archive")
|
||||||
|
|
||||||
@@ -256,9 +264,15 @@ class FFmpegDownloader:
|
|||||||
with tarfile.open(archive_path, "r:xz") as tar_ref:
|
with tarfile.open(archive_path, "r:xz") as tar_ref:
|
||||||
binary_names = self._get_binary_names()
|
binary_names = self._get_binary_names()
|
||||||
for binary_name in binary_names:
|
for binary_name in binary_names:
|
||||||
|
# BtbN's builds have binaries in bin directory
|
||||||
binary_files = [
|
binary_files = [
|
||||||
f for f in tar_ref.getnames() if f.endswith(f"/{binary_name}")
|
f for f in tar_ref.getnames() if f.endswith(f"/bin/{binary_name}")
|
||||||
]
|
]
|
||||||
|
if not binary_files:
|
||||||
|
# Fallback to old structure
|
||||||
|
binary_files = [
|
||||||
|
f for f in tar_ref.getnames() if f.endswith(f"/{binary_name}")
|
||||||
|
]
|
||||||
if not binary_files:
|
if not binary_files:
|
||||||
raise DownloadError(f"{binary_name} not found in archive")
|
raise DownloadError(f"{binary_name} not found in archive")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user