[PR #4945] [CLOSED] Add YouTube download feature with yt-dlp integration #4380

Closed
opened 2026-04-25 00:19:31 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4945
Author: @ivanberry
Created: 12/31/2025
Status: Closed

Base: masterHead: claude/add-youtube-download-JYy2I


📝 Commits (1)

  • aaf8782 Add YouTube download feature with yt-dlp integration

📊 Changes

11 files changed (+1253 additions, -2 deletions)

View changed files

📝 client/components/app/Appbar.vue (+9 -0)
client/components/modals/YouTubeDownloadModal.vue (+202 -0)
📝 client/layouts/default.vue (+28 -0)
📝 client/store/globals.js (+4 -0)
📝 package-lock.json (+8 -1)
📝 package.json (+2 -1)
server/controllers/YouTubeDownloadController.js (+166 -0)
server/managers/YouTubeDownloadManager.js (+486 -0)
server/objects/YouTubeDownload.js (+196 -0)
📝 server/routers/ApiRouter.js (+8 -0)
server/utils/youtubeUtils.js (+144 -0)

📄 Description

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: /
  • 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

Brief summary

Which issue is fixed?

In-depth Description

How have you tested this?

Screenshots


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/4945 **Author:** [@ivanberry](https://github.com/ivanberry) **Created:** 12/31/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `claude/add-youtube-download-JYy2I` --- ### 📝 Commits (1) - [`aaf8782`](https://github.com/advplyr/audiobookshelf/commit/aaf87821a38c151f9633e359f520939d4333cc98) Add YouTube download feature with yt-dlp integration ### 📊 Changes **11 files changed** (+1253 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `client/components/app/Appbar.vue` (+9 -0) ➕ `client/components/modals/YouTubeDownloadModal.vue` (+202 -0) 📝 `client/layouts/default.vue` (+28 -0) 📝 `client/store/globals.js` (+4 -0) 📝 `package-lock.json` (+8 -1) 📝 `package.json` (+2 -1) ➕ `server/controllers/YouTubeDownloadController.js` (+166 -0) ➕ `server/managers/YouTubeDownloadManager.js` (+486 -0) ➕ `server/objects/YouTubeDownload.js` (+196 -0) 📝 `server/routers/ApiRouter.js` (+8 -0) ➕ `server/utils/youtubeUtils.js` (+144 -0) </details> ### 📄 Description 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 <!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. If you do not follow this template, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary <!-- Please provide a brief summary of what your PR attempts to achieve. --> ## Which issue is fixed? <!-- Which issue number does this PR fix? Ex: "Fixes #1234" --> ## In-depth Description <!-- Describe your solution in more depth. How does it work? Why is this the best solution? Does it solve a problem that affects multiple users or is this an edge case for your setup? --> ## How have you tested this? <!-- Please describe in detail with reproducible steps how you tested your changes. --> ## Screenshots <!-- If your PR includes any changes to the web client, please include screenshots or a short video from before and after your changes. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:19:31 +02:00
adam closed this issue 2026-04-25 00:19:32 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4380