Updated default_guild_settings in core/base.py from 25MB to 8MB

Verified consistency with config_manager.py which already had 8MB as default
Confirmed proper validation in config_manager.py (allows 1-100MB range)
Verified all other files reference the max_file_size setting correctly
This commit is contained in:
pacnpal
2024-11-15 20:11:43 +00:00
parent 42b3ceb314
commit 121e1395f4
4 changed files with 94 additions and 46 deletions

View File

@@ -8,7 +8,7 @@ Welcome to **Pac-cogs**, a collection of custom cogs for [Red](https://github.co
|------------|--------------------------------------------------| |------------|--------------------------------------------------|
| **Birthday** | Assigns a special birthday role to users and sends a celebratory message with random cake or pie emojis. Features include: automatic role removal at midnight in configurable timezone, custom announcement channels, role-based command permissions, random cake/pie emoji generation, task persistence across bot restarts, context menu support (right-click user to assign role), birthday role removal task checking, and no hierarchy requirements for role assignment. Perfect for automated birthday celebrations! | | **Birthday** | Assigns a special birthday role to users and sends a celebratory message with random cake or pie emojis. Features include: automatic role removal at midnight in configurable timezone, custom announcement channels, role-based command permissions, random cake/pie emoji generation, task persistence across bot restarts, context menu support (right-click user to assign role), birthday role removal task checking, and no hierarchy requirements for role assignment. Perfect for automated birthday celebrations! |
| **Overseerr** | Allows interaction with [Overseerr](https://overseerr.dev/) directly from Discord. Users can search for movies or TV shows, request them, and have admins approve requests. Features include: media availability checking, request status tracking, admin role configuration, direct integration with Overseerr's API, and full slash command support. Requires a running Overseerr instance and API key. | | **Overseerr** | Allows interaction with [Overseerr](https://overseerr.dev/) directly from Discord. Users can search for movies or TV shows, request them, and have admins approve requests. Features include: media availability checking, request status tracking, admin role configuration, direct integration with Overseerr's API, and full slash command support. Requires a running Overseerr instance and API key. |
| **VideoArchiver** | A powerful video archiving cog that automatically downloads and reposts videos from monitored channels. Features hardware-accelerated compression (NVIDIA, AMD, Intel, ARM), multi-video processing, modular queue system with priority processing and state persistence, role-based permissions, automatic file cleanup, and support for multiple video platforms via yt-dlp. The enhanced queue system provides metrics tracking, health monitoring, and efficient resource management while maintaining quality. | | **VideoArchiver** | A powerful video archiving cog that automatically downloads and reposts videos from monitored channels. Features hardware-accelerated compression (NVIDIA, AMD, Intel, ARM), multi-video processing, modular queue system with priority processing and state persistence, role-based permissions, automatic file cleanup, and support for multiple video platforms via yt-dlp. The enhanced queue system provides metrics tracking, health monitoring, and efficient resource management while maintaining quality. New features include: video archive database for tracking and retrieving archived videos, detailed queue monitoring with real-time progress tracking, and comprehensive error handling with automatic recovery. |
## Installation ## Installation

View File

@@ -46,11 +46,11 @@ Before using the cog, you need to set it up. You can use either prefix commands
2. Add roles that can use the birthday command: 2. Add roles that can use the birthday command:
``` ```
[p]addrole @Moderator [p]birthdayallowrole @Moderator
``` ```
or or
``` ```
/addrole @Moderator /birthdayallowrole @Moderator
``` ```
3. (Optional) Set the timezone for role expiration: 3. (Optional) Set the timezone for role expiration:
@@ -77,9 +77,9 @@ Before using the cog, you need to set it up. You can use either prefix commands
## Usage ## Usage
To assign the birthday role to a user, you can use any of these methods: To assign or remove the birthday role from a user, you can use any of these methods:
1. Command: 1. Commands:
``` ```
[p]birthday @User [p]birthday @User
``` ```
@@ -88,10 +88,20 @@ To assign the birthday role to a user, you can use any of these methods:
/birthday @User /birthday @User
``` ```
2. Context Menu: To remove:
Right-click on a user and select "Apps > Give Birthday Role" ```
[p]removebirthday @User
```
or
```
/removebirthday @User
```
This will assign the birthday role to the user and send a celebratory message with random cake (or pie) emojis. The role will be automatically removed at midnight in the specified timezone. 2. Context Menu:
- Right-click on a user and select "Apps > Give Birthday Role" to assign
- Right-click on a user and select "Apps > Remove Birthday Role" to remove
When assigning the role, this will give the user the birthday role and send a celebratory message with random cake (or pie) emojis. The role will be automatically removed at midnight in the specified timezone.
## Features ## Features
@@ -105,6 +115,7 @@ This will assign the birthday role to the user and send a celebratory message wi
- Full slash command and context menu support - Full slash command and context menu support
- Persistent birthday role removal scheduling (survives bot restarts) - Persistent birthday role removal scheduling (survives bot restarts)
- Birthday role removal task checking - Birthday role removal task checking
- Manual birthday role removal option
## Commands ## Commands
@@ -112,14 +123,16 @@ All commands support both prefix and slash command syntax:
### Admin Commands ### Admin Commands
- `[p]setrole` or `/setrole`: Set the birthday role - `[p]setrole` or `/setrole`: Set the birthday role
- `[p]addrole` or `/addrole`: Add a role that can use the birthday command - `[p]birthdayallowrole` or `/birthdayallowrole`: Add a role that can use the birthday command
- `[p]removerole` or `/removerole`: Remove a role from using the birthday command - `[p]birthdayremoverole` or `/birthdayremoverole`: Remove a role from using the birthday command
- `[p]settimezone` or `/settimezone`: Set the timezone for the birthday role expiration - `[p]settimezone` or `/settimezone`: Set the timezone for the birthday role expiration
- `[p]setchannel` or `/setchannel`: Set the channel for birthday announcements - `[p]setchannel` or `/setchannel`: Set the channel for birthday announcements
### User Commands ### User Commands
- `[p]birthday` or `/birthday`: Assign the birthday role to a user - `[p]birthday` or `/birthday`: Assign the birthday role to a user
- `[p]removebirthday` or `/removebirthday`: Remove the birthday role from a user
- Context Menu > "Give Birthday Role": Right-click a user to assign the birthday role - Context Menu > "Give Birthday Role": Right-click a user to assign the birthday role
- Context Menu > "Remove Birthday Role": Right-click a user to remove the birthday role
- `[p]bdaycheck` or `/bdaycheck`: Check upcoming birthday role removal tasks - `[p]bdaycheck` or `/bdaycheck`: Check upcoming birthday role removal tasks
## Support ## Support

View File

@@ -10,28 +10,48 @@ A powerful video archiving cog that automatically downloads and reposts videos f
- Hardware-accelerated compression (NVIDIA, AMD, Intel, ARM) - Hardware-accelerated compression (NVIDIA, AMD, Intel, ARM)
- Configurable video quality and format - Configurable video quality and format
- Automatic file size optimization for Discord limits - Automatic file size optimization for Discord limits
- Default maximum file size: 8MB
- Default video format: MP4
- Default video quality: High
- **Video Archive Database**
- Track and store archived video information
- Query archived videos by original URL
- Get Discord links for previously archived videos
- Optional database functionality (disabled by default)
- Automatic database management and cleanup
- Persistent video history tracking
- **Modular Queue System** - **Modular Queue System**
- Priority-based processing with state persistence - Priority-based processing with state persistence
- Efficient resource management and monitoring - Efficient resource management and monitoring
- Real-time performance metrics and health checks - Real-time performance metrics and health checks
- Automatic cleanup and memory optimization - Automatic cleanup and memory optimization
- Component-based architecture: - Default concurrent downloads: 2 (configurable 1-5)
- Queue state persistence and recovery - Maximum queue size: 1000 items
- Health monitoring and metrics tracking - Automatic retry on failures (3 attempts)
- Resource cleanup and maintenance - Queue state persistence across bot restarts
- Core queue operations management
- **Progress Tracking**
- Real-time download progress monitoring
- Compression progress tracking
- Hardware acceleration statistics
- Detailed error tracking and analysis
- Memory usage monitoring
- Success rate calculations
- Automatic cleanup of temporary files
- **Channel Management** - **Channel Management**
- Flexible channel monitoring (specific channels or all) - Flexible channel monitoring (specific channels or all)
- Separate archive, notification, and log channels - Separate archive, notification, and log channels
- Customizable message templates - Customizable message templates
- Configurable message duration - Configurable message duration (default: 30 seconds)
- **Access Control** - **Access Control**
- Role-based permissions - Role-based permissions
- Site-specific enabling/disabling - Site-specific enabling/disabling
- Admin-only configuration commands - Admin-only configuration commands
- Per-guild settings
## Installation ## Installation
@@ -62,6 +82,19 @@ All commands support both prefix and slash command syntax:
- **`va_update`**: Update yt-dlp to latest version - **`va_update`**: Update yt-dlp to latest version
- **`va_toggleupdates`**: Toggle update notifications - **`va_toggleupdates`**: Toggle update notifications
### Archiver Management Commands (archiver_)
- **`archiver enable`**: Enable video archiving in the server
- **`archiver disable`**: Disable video archiving in the server
- **`archiver setchannel <channel>`**: Set the archive channel
- **`archiver setlog <channel>`**: Set the log channel
- **`archiver addchannel <channel>`**: Add a channel to monitor
- **`archiver removechannel <channel>`**: Remove a channel from monitoring
### Database Management Commands (archivedb_)
- **`archivedb enable`**: Enable the video archive database
- **`archivedb disable`**: Disable the video archive database
- **`checkarchived <url>`**: Check if a video URL has been archived
### Queue Management Commands (vaq_) ### Queue Management Commands (vaq_)
- **`vaq_status`**: Show current queue status with basic metrics - **`vaq_status`**: Show current queue status with basic metrics
- **`vaq_metrics`**: Show detailed queue performance metrics - **`vaq_metrics`**: Show detailed queue performance metrics
@@ -83,32 +116,24 @@ All commands support both prefix and slash command syntax:
- **`vas_enable [sites...]`**: Enable specific sites (empty for all) - **`vas_enable [sites...]`**: Enable specific sites (empty for all)
- **`vas_list`**: List available and enabled sites - **`vas_list`**: List available and enabled sites
## Queue System Architecture ## Default Settings
The queue system is built with a modular, component-based architecture: ```python
{
### Core Components "enabled": False, # Video archiving disabled by default
- **Models**: Data structures for queue items and metrics "archive_channel": None, # Must be set before use
- **Persistence**: Queue state persistence and recovery "log_channel": None, # Optional error logging channel
- **Monitoring**: Health checks and performance metrics "enabled_channels": [], # Channels to monitor
- **Cleanup**: Resource management and maintenance "video_format": "mp4", # Default video format
- **Manager**: Core queue operations and coordination "video_quality": "high", # Default video quality
"max_file_size": 8, # Maximum file size in MB
### Metrics and Monitoring "message_duration": 30, # Message duration in seconds
- Real-time queue status and health monitoring "message_template": "{author} archived a video from {channel}",
- Comprehensive performance metrics: "concurrent_downloads": 2, # Number of concurrent downloads
- Processing counts and success rates "enabled_sites": None, # None means all sites enabled
- Hardware acceleration statistics "use_database": False # Database tracking disabled by default
- Memory usage tracking }
- Error distribution analysis ```
- Automatic recovery from failures
- Resource usage optimization
### State Management
- Persistent queue state across bot restarts
- Efficient memory management
- Automatic cleanup of old entries
- Priority-based processing
## Message Templates ## Message Templates
@@ -116,25 +141,32 @@ You can customize archive messages using these variables:
- `{author}`: Original message author - `{author}`: Original message author
- `{url}`: Original video URL - `{url}`: Original video URL
- `{original_message}`: Link to original message - `{original_message}`: Link to original message
- `{channel}`: Original channel name
Example template: Example template:
``` ```
📥 Video archived from {author} 📥 Video archived from {author}
Original: {url} Original: {url}
Source: {original_message} Source: {original_message}
Channel: {channel}
``` ```
## Site Support ## Site Support
The cog supports all sites compatible with yt-dlp. Use `vas_list` to see available sites and currently enabled ones. The cog supports all sites compatible with yt-dlp. Use `vas_list` to see available sites and currently enabled ones.
## Performance ## Performance & Limitations
- Hardware acceleration automatically detected and utilized - Hardware acceleration automatically detected and utilized
- Configurable concurrent downloads (1-5) - Configurable concurrent downloads (1-5)
- Automatic file size optimization - Maximum queue size: 1000 items
- Memory-efficient queue management - Maximum file size: 8MB by default (configurable up to Discord's limit)
- Automatic cleanup of temporary files - Maximum video quality: 4320p (8K)
- Automatic retry on failures (3 attempts with 5-second delay)
- Queue cleanup interval: 30 minutes
- Maximum history age: 24 hours
- Unload timeout: 30 seconds
- Cleanup timeout: 15 seconds
## Error Handling ## Error Handling
@@ -143,6 +175,9 @@ The cog supports all sites compatible with yt-dlp. Use `vas_list` to see availab
- Automatic retry mechanism - Automatic retry mechanism
- Queue persistence across restarts - Queue persistence across restarts
- Detailed error messages - Detailed error messages
- Error type tracking and analysis
- Automatic recovery procedures
- Force cleanup on timeout
## Support ## Support

View File

@@ -41,7 +41,7 @@ class VideoArchiver(commands.Cog):
"enabled_channels": [], "enabled_channels": [],
"video_format": "mp4", "video_format": "mp4",
"video_quality": "high", "video_quality": "high",
"max_file_size": 25, # MB "max_file_size": 8, # MB
"message_duration": 30, # seconds "message_duration": 30, # seconds
"message_template": "{author} archived a video from {channel}", "message_template": "{author} archived a video from {channel}",
"concurrent_downloads": 2, "concurrent_downloads": 2,