audiobookshelf/server/objects
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
..
files Fix API including basepath in tracks contentUrl 2025-02-01 16:47:36 -06:00
metadata Migrate tools and collapse series. fix continue shelves. remove old objects 2025-01-05 14:09:03 -06:00
settings CORS 2025-08-03 13:52:58 +02:00
Backup.js Update Backup to use key to check for old backups no longer supported 2023-07-14 14:20:35 -05:00
DailyLog.js Update:Log uncaught exceptions to crash_logs.txt #706 & cleanup logger 2024-02-15 16:46:19 -06:00
DeviceInfo.js Update Dockerfile for sqlite3, update models for cascade delete, fix backup schedule 2023-07-09 11:39:15 -05:00
Notification.js Init sqlite take 2 2023-07-04 18:14:44 -05:00
PlaybackSession.js Update PlaybackSession to use new library item model 2025-01-03 11:16:03 -06:00
PodcastEpisodeDownload.js Update podcast episode downloads to always attempt embedding meta tags regardless of format 2025-08-17 09:05:29 -05:00
Stream.js Update Stream ac3/eac3 check 2025-11-08 17:08:43 -06:00
Task.js Update:Added string localization for tasks #3303 #3352 2024-09-21 14:02:57 -05:00
TrackProgressMonitor.js Improve documentation and arg names in TrackProgressMonitor.js 2024-07-20 21:42:58 +03:00
YouTubeDownload.js Add YouTube download feature with yt-dlp integration 2025-12-31 01:32:37 +00:00