Commit Graph

25 Commits

Author SHA1 Message Date
pacnpal
e66af6e844 Added timeout handling and force cleanup in VideoArchiver cog
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
2024-11-15 15:48:03 +00:00
pacnpal
0d7b1d449f Made secure_delete_file and cleanup_downloads async in file_ops.py
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
2024-11-15 13:47:28 +00:00
pacnpal
f8fe409cdd Architecture Changes:
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
2024-11-15 05:17:21 +00:00
pacnpal
e4429a9d9e Fixed Exception Structure:
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
2024-11-15 04:34:35 +00:00
pacnpal
c144fb35ba The video downloading issues have been resolved by implementing comprehensive error handling and resource management:
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
2024-11-15 04:18:57 +00:00
pacnpal
8503fc6fdd Enhanced FFmpeg Integration:
Added robust error handling and logging
Improved binary verification and initialization
Added proper GPU detection and hardware acceleration
Optimized encoding parameters for different content types
Improved File Operations:

Added retry mechanisms for file operations
Enhanced temporary directory management
Improved cleanup of failed downloads
Added proper permission handling
Enhanced Queue Management:

Fixed queue manager initialization
Added better error recovery
Improved status tracking and logging
Enhanced cleanup of failed items
Better Error Handling:

Added comprehensive exception hierarchy
Improved error logging and reporting
Added fallback mechanisms for failures
Enhanced error recovery strategies
2024-11-15 03:21:25 +00:00
pacnpal
0df5c879bb fix: Improve VideoArchiver cog structure - Remove command registration (handled by commands.py) - Ensure data directories exist - Add better initialization and cleanup - Improve error handling 2024-11-15 01:03:30 +00:00
pacnpal
c2f5a6b461 fix: Improve cog initialization and cleanup - Ensure proper component initialization - Add better error handling - Improve cleanup process 2024-11-15 01:01:48 +00:00
pacnpal
4e632276c2 fix: Resolve command registration issues - Separate command handling into VideoArchiverCommands - Update command registration in __init__.py - Remove duplicate command registration 2024-11-15 00:50:55 +00:00
pacnpal
ba71081687 fix: Properly implement slash commands - Use app_commands for slash command support - Add proper command group structure - Handle command registration and syncing 2024-11-15 00:45:13 +00:00
pacnpal
1588c5cb96 fix: Improve command handling and defaults - Add fallback for hybrid commands - Make addmonitor and addrole use defaults - Fix async cog loading 2024-11-15 00:40:12 +00:00
pacnpal
fa4c2ec208 fix: Remove manual command syncing and let Red-DiscordBot handle it 2024-11-15 00:30:45 +00:00
pacnpal
f6edef4658 fix: Properly initialize and register hybrid commands for both slash and legacy support 2024-11-15 00:26:48 +00:00
pacnpal
7a0fd441b0 fix: Properly delegate commands and add guild-only restrictions 2024-11-15 00:20:32 +00:00
pacnpal
cb130358fb fix: Remove duplicate hybrid command decorations to resolve command callback error 2024-11-15 00:10:50 +00:00
pacnpal
f3d28231e8 fix imports 2024-11-14 23:45:36 +00:00
pacnpal
d8ca4e5b8e fix imports 2024-11-14 23:24:48 +00:00
pacnpal
73f142addd fixed issues 2024-11-14 21:36:58 +00:00
pacnpal
fdebc0f494 Update message format and links
- 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
2024-11-14 20:44:43 +00:00
pacnpal
acef03ba18 Update message handling and reactions
- 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
2024-11-14 20:43:27 +00:00
pacnpal
c63d884f67 Improve error handling and task management
- Add custom exception classes for better error handling
- Add better error logging to Discord channels with retries
- Add proper task tracking with error callbacks
- Add better cleanup and resource management
- Add better version comparison for updates
- Add retries for Discord API operations
- Add better error context and recovery
- Add better component lifecycle management
2024-11-14 20:38:12 +00:00
pacnpal
2b9a070896 Improve error handling and dependencies
- Add aiohttp to requirements for better async HTTP handling
- Add proper timeout handling for GitHub API requests
- Add better error logging with tracebacks to Discord channels
- Add better task tracking and cleanup
- Add better file cleanup handling
- Add better component lifecycle management
2024-11-14 20:10:01 +00:00
pacnpal
69078025f6 Improve VideoArchiver cog reliability and resource management
- 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
2024-11-14 20:01:12 +00:00
pacnpal
a8cbe110a4 Improve VideoArchiver cog reliability
- Add proper error handling for pkg_resources import
- Add setuptools to requirements for pkg_resources
- Add last_update_check tracking to prevent excessive checks
- Add timeout to GitHub API requests
- Improve error handling in update checker
- Add update check status to settings display
- Fix potential race conditions in update checker
2024-11-14 19:58:34 +00:00
pacnpal
6c2e277211 Add yt-dlp update functionality to VideoArchiver cog
- 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
2024-11-14 19:51:43 +00:00