audiobookshelf/server/managers
Claude aaf87821a3
Add YouTube download feature with yt-dlp integration
This commit implements a comprehensive YouTube download feature that allows
administrators to download audio from YouTube videos and playlists.

Backend Changes:
- Add yt-dlp-wrap npm dependency for YouTube downloading
- Create YouTubeDownloadManager to handle download queue and execution
- Create YouTubeDownloadController with API endpoints for download/queue/cancel
- Add YouTube utility functions for URL validation and metadata extraction
- Create YouTubeDownload object model for tracking download state
- Add API routes: POST /api/youtube/download, GET /api/youtube/queue, DELETE /api/youtube/download/:id
- Implement playlist support - automatically queue all videos from playlist URLs
- Download audio in MP3 format with best quality
- Organize files in subfolder structure: <Uploader>/<Video Title>/
- Extract metadata and create library items automatically
- Real-time progress updates via Socket.io

Frontend Changes:
- Create YouTubeDownloadModal component for user-friendly download interface
- Add download button to Appbar header (admin-only, visible with current library)
- Update Vuex store with modal state management
- Register modal globally in default layout
- Implement Socket.io listeners for download events (started, progress, completed, failed, queued)
- Show toast notifications for download status updates

Features:
- Admin-only access control
- Support for single videos and playlists
- Audio quality selection (best, 320kbps, 256kbps, 192kbps, 128kbps)
- Library and folder selection
- Download queue management
- Real-time progress tracking
- Automatic thumbnail download as cover image
- Automatic library item creation with metadata
- Error handling and user feedback

Technical Details:
- Uses yt-dlp for reliable YouTube downloading
- Integrates with existing task management system
- Respects library folder permissions
- Follows existing code patterns (similar to podcast downloads)
- Socket.io events for real-time updates
2025-12-31 01:32:37 +00:00
..
AbMergeManager.js Fix m4b encoder backup file overwriting the encoded file when they have the same filename 2025-06-02 16:50:03 -05:00
ApiCacheManager.js Revert case-insensitive cache manager update in #3780 2025-01-20 08:59:45 -06:00
AudioMetadataManager.js Migrate tools and collapse series. fix continue shelves. remove old objects 2025-01-05 14:09:03 -06:00
BackupManager.js BackupManager: Remove backup fallback logic 2025-12-01 18:54:43 +02:00
BinaryManager.js Use musl-based libnusqlite3 in Docker 2024-10-07 20:48:52 +03:00
CacheManager.js Wrap ensureDir in try-catch blocks 2025-12-01 18:00:34 +02:00
CoverManager.js Migrate to new library item in scanner 2025-01-05 12:05:01 -06:00
CoverSearchManager.js CoverSearchManager: Fix broken podcast cover search 2025-10-17 08:11:03 +03:00
CronManager.js Update API Keys to be tied to a user, add apikey lru-cache, handle deactivating expired keys 2025-06-30 14:53:11 -05:00
EmailManager.js Update Dockerfile for sqlite3, update models for cascade delete, fix backup schedule 2023-07-09 11:39:15 -05:00
LogManager.js Wrap ensureDir in try-catch blocks 2025-12-01 18:00:34 +02:00
MigrationManager.js Wrap ensureDir in try-catch blocks 2025-12-01 18:00:34 +02:00
NotificationManager.js Fix notification js docs and update description/defaults 2025-06-09 16:21:05 -05:00
PlaybackSessionManager.js Wrap ensureDir in try-catch blocks 2025-12-01 18:00:34 +02:00
PodcastManager.js Fix issue with episode downloads without streams, fallback to regular dl on ffprobe fail 2025-09-10 17:10:00 -05:00
RssFeedManager.js Fix server crash when feed cover image is requested but doesnt exist 2025-02-11 16:14:49 -06:00
ShareManager.js Fix:Shares not working with timeouts longer than 23 days #3164 2024-07-27 17:40:51 -05:00
TaskManager.js Update:Added string localization for tasks #3303 #3352 2024-09-21 14:02:57 -05:00
YouTubeDownloadManager.js Add YouTube download feature with yt-dlp integration 2025-12-31 01:32:37 +00:00