audiobookshelf/server
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
..
auth Chnage Auth Expiry 2025-10-19 09:22:12 +02:00
controllers Add YouTube download feature with yt-dlp integration 2025-12-31 01:32:37 +00:00
finders Fix Upload Lookup 2025-11-29 11:02:42 +01:00
libs Add fuse.basic.min.js in libs instead of full npm package, use lower threshold for quick matching 2025-06-13 17:23:24 -05:00
managers Add YouTube download feature with yt-dlp integration 2025-12-31 01:32:37 +00:00
migrations 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
models Fix podcast itunesId not set on create or update from match #4614 2025-08-22 08:20:49 -05:00
objects Add YouTube download feature with yt-dlp integration 2025-12-31 01:32:37 +00:00
providers Fix server crash on audible match #4931 2025-12-23 16:44:29 -06:00
routers Add YouTube download feature with yt-dlp integration 2025-12-31 01:32:37 +00:00
scanner Auto-formatting 2025-12-21 14:45:04 -06:00
utils Add YouTube download feature with yt-dlp integration 2025-12-31 01:32:37 +00:00
Auth.js Add additional debug logs for OIDC login 2025-08-15 17:23:20 -05:00
Database.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
Logger.js Simplify log level determination 2025-03-08 12:46:36 -07:00
Server.js Update for nextjs client, pass all remaining requests through to nextjs 2025-09-28 09:41:15 -05:00
SocketAuthority.js Replace cover search with streaming version 2025-10-02 13:30:03 +03:00
Watcher.js Add: generic function to ignor files 2025-02-22 12:28:51 -07:00