mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 10:51:05 -05:00
Switching from regex patterns to yt-dlp simulation for URL detection:
Removed the regex-based URL detection Added proper yt-dlp simulation to check if URLs are supported Added better error handling for URL checking Added detailed logging of URL detection results Improving FFmpeg integration: Added proper ffprobe binary download alongside FFmpeg Added better verification of both binaries Added retry mechanisms for binary downloads Added proper cleanup of failed downloads Enhancing error handling and logging: Added detailed logging throughout the system Added better error recovery mechanisms Added proper cleanup of temporary files Added better tracking of failed operations
This commit is contained in:
@@ -316,15 +316,22 @@ class VideoProcessor:
|
||||
if monitored_channels and message.channel.id not in monitored_channels:
|
||||
return
|
||||
|
||||
# Find all video URLs in message with improved pattern matching
|
||||
# Find all video URLs in message using yt-dlp simulation
|
||||
logger.info(f"Checking message {message.id} for video URLs...")
|
||||
urls = []
|
||||
if message.guild.id in self.components:
|
||||
downloader = self.components[message.guild.id]["downloader"]
|
||||
if downloader:
|
||||
# Check each word in the message
|
||||
for word in message.content.split():
|
||||
if downloader.is_supported_url(word):
|
||||
urls.append(word)
|
||||
# Use yt-dlp simulation to check if URL is supported
|
||||
try:
|
||||
if downloader.is_supported_url(word):
|
||||
logger.info(f"Found supported URL: {word}")
|
||||
urls.append(word)
|
||||
except Exception as e:
|
||||
logger.error(f"Error checking URL {word}: {str(e)}")
|
||||
continue
|
||||
|
||||
if urls:
|
||||
logger.info(f"Found {len(urls)} video URLs in message {message.id}")
|
||||
|
||||
Reference in New Issue
Block a user