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:
pacnpal
2024-11-15 04:20:17 +00:00
parent c144fb35ba
commit 9824469984

View File

@@ -237,6 +237,14 @@ class FFmpegDownloader:
with zipfile.ZipFile(archive_path, "r") as zip_ref:
binary_names = self._get_binary_names()
for binary_name in binary_names:
# BtbN's builds have binaries in bin directory
binary_files = [
f
for f in zip_ref.namelist()
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()
@@ -256,6 +264,12 @@ class FFmpegDownloader:
with tarfile.open(archive_path, "r:xz") as tar_ref:
binary_names = self._get_binary_names()
for binary_name in binary_names:
# BtbN's builds have binaries in bin directory
binary_files = [
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}")
]