Add support for yt-dlp with NodeJS
This commit is contained in:
@@ -158,6 +158,19 @@ async def download_media(
|
||||
'ignoreerrors': False,
|
||||
}
|
||||
|
||||
# Check if Node.js is available for JS extraction (required for Instagram, TikTok, etc.)
|
||||
import shutil
|
||||
nodejs_path = shutil.which('node')
|
||||
if nodejs_path:
|
||||
logger.debug(f"Node.js found at: {nodejs_path}. JS extraction will be available.")
|
||||
# yt-dlp will automatically use Node.js if available
|
||||
# Optionally, we can explicitly set it via extractor_args if needed
|
||||
else:
|
||||
logger.warning(
|
||||
"Node.js not found. Some sites (Instagram, TikTok, etc.) may require JS extraction. "
|
||||
"Install Node.js for full functionality."
|
||||
)
|
||||
|
||||
# Add cookies if specified (for Instagram and other sites)
|
||||
if cookies_file:
|
||||
# Resolve cookies file path (support relative and absolute paths)
|
||||
|
||||
Reference in New Issue
Block a user