This commit is contained in:
Andrey Kondratev
2025-08-28 16:37:59 +05:00
parent 913f833b8c
commit b8e2bf1090
23 changed files with 838 additions and 7 deletions

View File

@@ -0,0 +1,20 @@
# 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
1. **Installed yt-dlp system dependency** - More reliable YouTube downloader that better handles bot detection
2. **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 `spawn` import 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.