863 B
863 B
YouTube Bot Detection Fix - Progress Note
Problem Identified
YouTube was blocking requests with "Sign in to confirm you're not a bot" error when trying to download audio streams.
Solutions Implemented
- Installed yt-dlp system dependency - More reliable YouTube downloader that better handles bot detection
- Updated YouTubeService - Added fallback mechanism:
- First tries play-dl (existing method)
- If that fails, falls back to yt-dlp system command
- yt-dlp gets direct audio URL then creates stream via axios
Code Changes
- Added
spawnimport for child process execution - Modified
getAudioStream()to try both methods - Added new
getAudioStreamWithYtDlp()method as fallback
Next Steps
User should restart server to test the fix. If still issues, they can set up YouTube cookies as documented in YOUTUBE_SETUP.md.