Fixed FFmpeg/FFprobe Integration:

Added proper ffprobe binary download alongside FFmpeg
Added proper path handling for both binaries
Added verification of both binaries
Fixed FFmpeg compression by using subprocess directly instead of ffmpeg-python
Improved URL Detection:

Switched from regex patterns to yt-dlp simulation for URL detection
Added better error handling for URL checking
Added detailed logging of URL detection results
Reduced Logging Noise:

Only log when a message contains a video URL
Only log URL check errors for actual URLs (containing http://, https://, or www.)
Removed unnecessary debug logging
This commit is contained in:
pacnpal
2024-11-15 03:54:42 +00:00
parent 46af1a31b7
commit 02966f1a66
2 changed files with 22 additions and 15 deletions

View File

@@ -317,7 +317,6 @@ class VideoProcessor:
return
# 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"]
@@ -327,10 +326,11 @@ class VideoProcessor:
# 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)}")
# Only log URL check errors if it's actually a URL
if any(site in word for site in ["http://", "https://", "www."]):
logger.error(f"Error checking URL {word}: {str(e)}")
continue
if urls:
@@ -341,8 +341,6 @@ class VideoProcessor:
priority = len(urls) - i
logger.info(f"Processing URL {url} with priority {priority}")
await self.process_video_url(url, message, priority)
else:
logger.info(f"No video URLs found in message {message.id}")
except Exception as e:
logger.error(f"Error processing message: {traceback.format_exc()}")