Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

141 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cortex-DL Logo

⚑ Cortex-DL

Release Platform License


πŸ› οΈ Built With

Electron React TypeScript Vite SQLite

yt-dlp FFmpeg Deno


Cortex-DL is an ultra-fast, feature-packed desktop download manager built with Electron, React, TypeScript, yt-dlp, FFmpeg, and SQLite.

It offers seamless media link analysis, multi-threaded downloading, custom format selection, FFmpeg post-processing, and queue state persistence across sessions. The Windows build comes pre-packaged with all required command-line binaries out of the box.


1. Features

  • 🎬 Multi-Source Extraction: Full URL analysis for 1000+ yt-dlp-supported sites, direct HTTP links, and HLS streams.
  • 🎨 Format & Quality Control: Video resolution selection, audio extraction, container conversion, and precision start/end trimming via FFmpeg.
  • ⚑ High Concurrency & Queue: Configurable simultaneous downloads (3, 5, or 10 items) powered by a SQLite persistent queue.
  • ⏯️ Full Playback & Queue Controls: Pause, resume, cancel, retry, delete, pause-all, and resume-all with automatic state recovery.
  • πŸ“œ Playlist & Batch Downloader: Select specific playlist items or process batch queues of up to 50 items at once.
  • πŸ’¬ Subtitles & Comments Export: Download and embed YouTube subtitles, plus export channel/video comments to structured text files.
  • πŸŽ₯ Integrated Media Player: Native preview for video and audio downloads with subtitle track auto-discovery, playback controls, and stream info overlay.
  • 🌐 Multilingual & System Integration: Seamless English & Arabic (RTL) interface, system tray minimization, native notifications, and yt-dlp auto-updates.
  • 🩺 Built-in System Health Check: Real-time diagnostic panel checking yt-dlp, FFmpeg, Deno runtime, cookies, and folder permissions.

2. Directory Structure

πŸ“‚ Full Project Tree

Cortex DL/
β”‚
β”œβ”€β”€ πŸ“ .github/                                # GitHub community templates & workflow rules
β”œβ”€β”€ πŸ“ assets/                                 # Application branding & README assets
β”‚   └── πŸ–ΌοΈ logo.png                            # Official Cortex-DL 3D Logo
β”œβ”€β”€ πŸ“„ .gitignore                              # Git ignore specifications
β”œβ”€β”€ πŸ“„ CODE_OF_CONDUCT.md                      # Community code of conduct
β”œβ”€β”€ πŸ“„ CONTRIBUTING.md                         # Developer contribution guidelines
β”œβ”€β”€ πŸ“„ LICENSE                                 # MIT License terms
β”œβ”€β”€ πŸ“„ README.md                               # Public project documentation
β”œβ”€β”€ πŸ“„ SECURITY.md                             # Security disclosure policy
β”œβ”€β”€ πŸ“„ package-lock.json                       # Root lockfile
β”œβ”€β”€ πŸ“„ package.json                            # Root package configuration
β”œβ”€β”€ βš™οΈ Cortex_Dev.bat                           # Windows development helper script
β”‚
└── πŸ“ app/                                    # Main application package
    β”œβ”€β”€ πŸ“ Back-End/                           # Backend services & IPC orchestration
    β”‚   └── πŸ“ electron/                       # Electron main process source code
    β”‚       β”œβ”€β”€ πŸ“„ main.ts                     # App entry point, window creation, service bootstrap
    β”‚       β”œβ”€β”€ πŸ“„ preload.ts                  # Secure contextBridge (window.cortexDl API)
    β”‚       β”œβ”€β”€ πŸ“„ tray.ts                     # System tray icon and menu management
    β”‚       β”œβ”€β”€ πŸ“„ downloadManager.ts          # Queue orchestration and concurrent scheduling
    β”‚       β”œβ”€β”€ πŸ“„ db.ts                       # SQLite setup and prepared statements
    β”‚       β”œβ”€β”€ πŸ“„ utils.ts                    # Utilities shared across backend modules
    β”‚       β”œβ”€β”€ πŸ“„ paths.ts                    # Binary and resource path resolution
    β”‚       β”œβ”€β”€ πŸ“„ ytdlp.ts                    # yt-dlp analysis, updates, and stream URL extraction
    β”‚       β”œβ”€β”€ πŸ“„ hls.ts                      # HLS playlist and stream variant analysis
    β”‚       β”œβ”€β”€ πŸ“„ ffmpegEngine.ts             # FFmpeg-based HLS and stream downloader
    β”‚       β”œβ”€β”€ πŸ“„ progressParser.ts           # yt-dlp and FFmpeg progress parsing
    β”‚       β”œβ”€β”€ πŸ“„ commentsExtractor.ts        # YouTube comment extraction through yt-dlp
    β”‚       β”œβ”€β”€ πŸ“„ types.ts                    # Backend types and re-exports
    β”‚       β”œβ”€β”€ πŸ“„ electron-env.d.ts           # Electron environment declarations
    β”‚       β”‚
    β”‚       β”œβ”€β”€ πŸ“ ipc/                        # Inter-process communication
    β”‚       β”‚   └── πŸ“„ handlers.ts             # Central IPC handler registration
    β”‚       β”‚
    β”‚       └── πŸ“ engines/                    # Download & media processing engines
    β”‚           β”œβ”€β”€ πŸ“„ IEngine.ts              # Download engine interface
    β”‚           β”œβ”€β”€ πŸ“„ DirectEngine.ts         # Chunked HTTP downloader
    β”‚           β”œβ”€β”€ πŸ“„ YoutubeEngine.ts        # yt-dlp process wrapper
    β”‚           β”œβ”€β”€ πŸ“„ FfmpegEngine.ts         # FFmpeg engine adapter
    β”‚           └── πŸ“„ MediaProcessor.ts       # Media merge, conversion, and FPS inspection
    β”‚
    β”œβ”€β”€ πŸ“ Front-End/                          # React user interface
    β”‚   β”œβ”€β”€ πŸ“„ index.html                      # Main HTML entry point
    β”‚   └── πŸ“ src/                            # React application source code
    β”‚       β”œβ”€β”€ πŸ“„ main.tsx                    # React entry point
    β”‚       β”œβ”€β”€ πŸ“„ App.tsx                     # Root renderer component
    β”‚       β”œβ”€β”€ πŸ“„ App.css                     # Global styles & layout rules
    β”‚       β”œβ”€β”€ πŸ“„ translations.ts             # Arabic and English UI strings
    β”‚       β”œβ”€β”€ πŸ“„ vite-env.d.ts               # Vite and Electron renderer declarations
    β”‚       β”‚
    β”‚       β”œβ”€β”€ πŸ“ components/                 # UI components & modular views
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ AddDownloadTab.tsx      # URL input, analysis, and format selection
    β”‚       β”‚   β”œβ”€β”€ πŸ“ AddDownloadTab/
    β”‚       β”‚   β”‚   β”œβ”€β”€ πŸ“„ UrlAnalysisView.tsx # Analysis results and format selection
    β”‚       β”‚   β”‚   β”œβ”€β”€ πŸ“„ PlaylistView.tsx    # Playlist item selection
    β”‚       β”‚   β”‚   └── πŸ“„ BatchListView.tsx   # Batch queue preview
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ DownloadList.tsx       # Download queue list
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ DownloadCard.tsx       # Individual download UI
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ DownloadCard.css       # Download card styles
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ SettingsTab.tsx        # Application settings
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ Sidebar.tsx            # Navigation sidebar
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ AdvancedTrimmer.tsx    # Start and end trim controls
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ AdvancedTrimmer.css    # Trimmer styles
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ AnimatedSegmentedControl.tsx
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ CustomDropdown.tsx
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ SimpleDownloader.tsx    # Quick-download mode
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ SmartImage.tsx          # Smart thumbnail loader & fallbacks
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ ConfirmModal.tsx       # Confirmation dialog
    β”‚       β”‚   └── πŸ“ MediaPlayer/            # Integrated media player
    β”‚       β”‚       β”œβ”€β”€ πŸ“„ MediaPlayerModal.tsx# Media player modal
    β”‚       β”‚       β”œβ”€β”€ πŸ“„ MediaPlayer.css     # Media player styles
    β”‚       β”‚       β”œβ”€β”€ πŸ“„ VideoPlayerView.tsx # Video playback view
    β”‚       β”‚       β”œβ”€β”€ πŸ“„ AudioPlayerView.tsx # Audio playback view
    β”‚       β”‚       β”œβ”€β”€ πŸ“„ PlayerControls.tsx  # Playback controls
    β”‚       β”‚       └── πŸ“„ MediaInfoOverlay.tsx# File metadata overlay
    β”‚       β”‚
    β”‚       β”œβ”€β”€ πŸ“ hooks/                      # Custom React hooks
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ types.ts                # Hook-level types
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ useDownloadController.ts# Download workflow
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ useHighFrequencyIPC.ts  # Throttled IPC and store updates
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ useDownloadCardVM.ts    # Download card view model
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ useAppController.ts     # App-level coordination
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ useSettingsController.ts# Settings and folder selection
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ useCommentsController.ts# Comment export workflow
    β”‚       β”‚   └── πŸ“„ useDebounce.ts          # Debounce utility
    β”‚       β”‚
    β”‚       β”œβ”€β”€ πŸ“ stores/                     # Global state management (Zustand)
    β”‚       β”‚   β”œβ”€β”€ πŸ“„ downloadStore.ts        # Zustand download state
    β”‚       β”‚   └── πŸ“„ useUIStore.ts           # Zustand UI state
    β”‚       β”‚
    β”‚       └── πŸ“ constants/                  # Configuration & constants
    β”‚           └── πŸ“„ formats.ts              # Supported output formats
    β”‚
    β”œβ”€β”€ πŸ“ Shared/                             # Shared type definitions
    β”‚   └── πŸ“„ types.ts                        # Types shared by backend and frontend
    β”‚
    β”œβ”€β”€ πŸ“ bin/                                # Bundled command-line executables
    β”‚   β”œβ”€β”€ ⚑ yt-dlp.exe                      # Media extraction and download engine
    β”‚   β”œβ”€β”€ ⚑ ffmpeg.exe                      # Media processing and HLS engine
    β”‚   β”œβ”€β”€ ⚑ ffprobe.exe                     # Media stream inspection tool
    β”‚   └── ⚑ deno.exe                        # JS runtime for yt-dlp workflows
    β”‚
    β”œβ”€β”€ πŸ“ scripts/                            # Build verification and post-processing scripts
    β”‚   β”œβ”€β”€ πŸ“„ ensure-electron.cjs             # Verifies Electron binary integrity
    β”‚   └── πŸ“„ strip-comments.cjs              # Build script for code stripping
    β”‚
    β”œβ”€β”€ πŸ“ build/                              # Packaging assets & icons
    β”œβ”€β”€ πŸ“ release/                            # Packaged installer output
    β”œβ”€β”€ πŸ“„ .env.example                        # Environment variable template
    β”œβ”€β”€ πŸ“„ .eslintrc.cjs                       # ESLint configuration
    β”œβ”€β”€ πŸ“„ vite.config.ts                      # Vite and Electron build configuration
    β”œβ”€β”€ πŸ“„ tsconfig.json                       # Root TypeScript configuration
    β”œβ”€β”€ πŸ“„ tsconfig.node.json                  # Node and Electron TypeScript config
    β”œβ”€β”€ πŸ“„ electron-builder.json5              # Packaging and installer configuration
    └── πŸ“„ package.json                        # App dependencies and scripts

3. Requirements

For local development and building from source:

  • OS: Windows x64 (current development scripts and bundled binaries target Windows).
  • Node.js: Modern LTS release (v18+ recommended) & npm.
  • Git: For repository cloning and version control.
  • Network: Internet connection for dependency installation, engine updates, and media downloading.

Note

All core execution binaries (yt-dlp.exe, ffmpeg.exe, ffprobe.exe, deno.exe) are pre-bundled in app/bin/. No additional manual installations are required for end users.


4. Development Setup

Clone the repository, navigate to the application package, install dependencies, and launch the Vite + Electron development environment:

# Clone the repository
git clone https://github.com/SAADX25/Cortex-DL.git

# Enter application directory
cd Cortex-DL\app

# Install dependencies
npm ci

# Launch development app
npm run dev

⚑ Development Helper Script (Windows)

Windows developers can also start the development environment directly from the repository root:

.\Cortex_Dev.bat

To execute code linting separately:

cd app
npm run lint

5. Build for Windows

To build a standalone production installer for Windows x64:

cd app
npm ci
npm run build

The build pipeline performs TypeScript verification, bundles Vite and Electron resources, and generates an NSIS installer under:

app/release/1.7.0/Cortex DL Setup 1.7.0.exe

6. Bundled Tools

The following executables are maintained under app/bin/ and automatically embedded into resources/bin/ during packaging:

Tool Status Description & Role
yt-dlp.exe Active Core media extraction, URL parsing, and stream downloading engine.
ffmpeg.exe Active Handles HLS stream capture, video/audio merging, format conversion, and trimming.
ffprobe.exe Active Inspects media file properties, streams, and embedded subtitle tracks.
deno.exe Active Modern JavaScript runtime required for advanced yt-dlp extractor scripts.

7. YouTube & Cookie Management

Important

Access to media on YouTube and restricted platforms may vary based on account status, region, age restrictions, or CAPTCHA challenges.

Cortex-DL supports configuring a Netscape-format cookies.txt file in Settings:

  • The uploaded file undergoes automatic format validation before use.
  • Cookies allow access to authenticated streams but must be kept secure. Do not share your cookie file.
  • Cortex-DL operates within platform access rules and does not bypass DRM restrictions.

8. Privacy & Local Data Security

Cortex-DL is built with a privacy-first architecture:

  • πŸ’Ύ Local Database: All download tasks, history, and status payloads are stored in tasks.sqlite within Electron's local app-data folder.
  • πŸ” Encrypted Credentials: User authentication credentials are encrypted using Electron's native safeStorage API prior to storage.
  • 🌐 Isolated Media Server: The built-in media streaming server binds strictly to 127.0.0.1 and enforces strict CORS and path verification.
  • πŸ›‘οΈ Sandbox Security: Renderer windows run with contextIsolation enabled, Node integration disabled, and explicit preload API bridges.

9. Troubleshooting

Tip

Use the Health Check panel in application Settings to quickly verify binary status and folder permissions.

YouTube requests sign-in or CAPTCHA

Export fresh Netscape-format cookies using a browser extension (e.g. Get cookies.txt LOCALLY) and load the file into Cortex-DL Settings.

Missing FFmpeg or yt-dlp binary error

Verify that app/bin/ contains all 4 executable files (yt-dlp.exe, ffmpeg.exe, ffprobe.exe, deno.exe). Antivirus software may occasionally quarantine executables.

Windows SmartScreen Warning

Click More Info -> Run Anyway. The installer is unsigned as it is an open-source development release.

App window hides on close

Cortex-DL minimizes to the Windows System Tray by default. Check the tray icon in the taskbar to reopen or quit the application.


Made with ❀️ by SAADX25

About

A fast, modern desktop app to download videos, audio, and playlists from various platforms.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

101 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages