mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 19:01:06 -05:00
fix: Change URL extraction in processor to use regex
- Replaced extractor.suitable() with direct regex pattern matching - Added check for _VALID_URL attribute - Improved error handling in URL extraction - Maintains compatibility with video_downloader.py changes
This commit is contained in:
@@ -197,7 +197,7 @@ class VideoArchiverCommands(commands.Cog):
|
||||
|
||||
# Verify sites are valid
|
||||
with yt_dlp.YoutubeDL() as ydl:
|
||||
valid_sites = set(ie.IE_NAME.lower() for ie in ydl._ies)
|
||||
valid_sites = set(ie.IE_NAME.lower() for ie in ydl._ies if hasattr(ie, 'IE_NAME'))
|
||||
invalid_sites = [s for s in site_list if s not in valid_sites]
|
||||
if invalid_sites:
|
||||
await ctx.send(
|
||||
@@ -217,7 +217,8 @@ class VideoArchiverCommands(commands.Cog):
|
||||
embed = discord.Embed(title="Video Sites Configuration", color=discord.Color.blue())
|
||||
|
||||
with yt_dlp.YoutubeDL() as ydl:
|
||||
all_sites = sorted(ie.IE_NAME for ie in ydl._ies if ie.IE_NAME is not None)
|
||||
# Filter out any extractors that don't have IE_NAME attribute
|
||||
all_sites = sorted(ie.IE_NAME for ie in ydl._ies if hasattr(ie, 'IE_NAME') and ie.IE_NAME is not None)
|
||||
|
||||
# Split sites into chunks for Discord's field value limit
|
||||
chunk_size = 20
|
||||
|
||||
Reference in New Issue
Block a user