mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 19:01:06 -05:00
URL Processing:
Added URL pre-filtering to avoid unnecessary yt-dlp checks Added common video platform patterns for quick filtering Reduced error logging noise from non-URL words Improved URL validation efficiency FFmpeg Management: Enhanced FFmpeg binary verification Added robust error handling for subprocess calls Improved cleanup of failed operations Added detailed logging for binary operations Error Handling: Fixed exception hierarchy in utils/exceptions.py Added proper error types for different failure scenarios Enhanced error messages with more context Improved error propagation through the system Process Flow: Added proper timeout handling for subprocess calls Enhanced environment variable handling Better cleanup after failures Added retry mechanisms for failed operations
This commit is contained in:
@@ -16,7 +16,9 @@ class DownloadError(FFmpegError):
|
||||
class VerificationError(FFmpegError):
|
||||
"""Exception raised when FFmpeg verification fails"""
|
||||
|
||||
pass
|
||||
def __init__(self, message: str, binary_type: str = "FFmpeg"):
|
||||
self.binary_type = binary_type
|
||||
super().__init__(f"{binary_type} verification failed: {message}")
|
||||
|
||||
|
||||
class EncodingError(FFmpegError):
|
||||
@@ -142,5 +144,9 @@ def handle_ffmpeg_error(error_output: str) -> FFmpegError:
|
||||
return BitrateError("Bitrate requirements not met", 0, 0)
|
||||
elif "timeout" in error_output:
|
||||
return TimeoutError("Operation timed out")
|
||||
elif "version" in error_output:
|
||||
return VerificationError("Version check failed")
|
||||
elif "verification" in error_output:
|
||||
return VerificationError(error_output)
|
||||
else:
|
||||
return FFmpegError(f"FFmpeg operation failed: {error_output}")
|
||||
|
||||
Reference in New Issue
Block a user