Added proper cancellation and requeuing of downloads in VideoProcessor
Added cancellable logger and process cleanup in VideoDownloader
Added shutdown flag and force_stop capability in EnhancedQueueManager
Added process tracking and kill_all_processes method in FFmpegManager
The changes ensure that:
Active downloads are paused and requeued when unload is called
If cleanup takes too long, force cleanup kicks in
All resources are properly cleaned up, even in case of timeout
Downloads can be safely cancelled and resumed later
No processes are left hanging during unload
Added chunked file processing and size limits to prevent blocking
Updated video_downloader.py to properly await secure_delete_file
Updated video_archiver.py to properly await cleanup_downloads
Simplified the secure deletion process while maintaining security
Added proper error handling and logging throughout
Moved FFmpeg manager to cog level instead of per-guild
Created single shared FFmpeg manager instance in VideoArchiver class
Passed shared FFmpeg manager to VideoProcessor and VideoDownloader
Removed redundant FFmpeg downloads for each guild
Component Management:
Updated VideoArchiver to initialize one FFmpeg manager
Modified guild components to remove FFmpeg manager
Updated component cleanup to handle shared resources
Improved resource initialization order
Resource Efficiency:
Eliminated duplicate FFmpeg binary downloads
Reduced disk space usage
Improved initialization time
Better resource sharing across guilds
Error Handling:
Added proper cleanup for shared resources
Improved error propagation
Enhanced initialization error handling
Better component lifecycle management
Added FileCleanupError to utils/exceptions.py
Created root exceptions.py for better organization
Fixed circular imports in utils/init.py
Updated imports in video_archiver.py and update_checker.py
Fixed FFmpeg Management:
Updated extraction logic for BtbN's new archive structure
Added fallback for backward compatibility
Better binary verification and permissions handling
Improved Error Handling:
Proper exception hierarchy
Better error propagation
More detailed error messages
Enhanced cleanup on errors
FFmpeg is now properly managed:
Binaries are downloaded and verified on startup
Permissions are properly set
Hardware acceleration is detected and used when available
Resources are cleaned up properly
Error handling has been improved:
Specific exception types for different errors
Better error messages and logging
Appropriate reaction indicators
Enhanced component error handling
Resource management has been enhanced:
Failed downloads are tracked and cleaned up
Temporary files are handled properly
Queue management is more robust
Concurrent downloads are better managed
Verification has been strengthened:
FFmpeg binaries are verified
Video files are validated
Compression results are checked
Component initialization is verified
- Add original message link to archive message
- Add original message link to notification
- Update message format for better readability
- Add better reaction cleanup
- Add better error context
- Add better task management
- Add 📹 reaction at start of processing
- Add ⏳ reaction during processing
- Change to ✅ when complete
- Update message template to show username and channel
- Remove author mention for cleaner format
- Add better reaction cleanup on errors
- Add better error context and handling
- Make ThreadPoolExecutor per-guild instead of global
- Add proper thread pool cleanup on shutdown
- Add concurrent_downloads parameter to VideoDownloader
- Add proper cleanup of message manager tasks
- Add better component cleanup on cog unload
- Improve error handling throughout the cog
- Fix potential resource leaks
- Add automatic yt-dlp version checking
- Add updateytdlp command for bot owners to update yt-dlp
- Add toggleupdates command to disable update notifications per guild
- Add disable_update_check setting to guild config
- Update README with new features and commands
- Improve update-related documentation