Metadata-Version: 2.4
Name: riplet
Version: 1.0.1
Summary: Riplet - Cross-platform YouTube downloader with GUI and CLI
Author-email: Lervez5 <enockbosire619@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/Lervez5/Riplet
Project-URL: Repository, https://github.com/Lervez5/Riplet.git
Project-URL: Issues, https://github.com/Lervez5/Riplet/issues
Keywords: youtube,downloader,gui,cli,yt-dlp,riplet
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: End Users/Desktop
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Video
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: yt-dlp>=2024.1.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pyinstaller>=6.0.0; extra == "dev"
Dynamic: license-file

# Riplet

A cross-platform desktop and terminal application for downloading YouTube videos and audio. Built on top of `yt-dlp` for robust, up-to-date YouTube support. Supports GUI mode, CLI mode, standalone executables, and auto-updates.

## Features

- Download videos as **MP4** or audio as **MP3** (192 kbps)
- **Quality / format selector** — pick 4K, 1080p, 720p, 480p, or best
- **Playlist support** — fetch and select individual items from a playlist
- **Browser cookie selector** — choose Chrome, Firefox, Brave, Edge, or Chromium
- `cookies.txt` fallback support
- **Subtitle download** — optional subtitles in multiple languages and formats
- **Resume** interrupted downloads
- Live **progress bar** with download speed and ETA
- **Cancel** active downloads
- Auto-paste YouTube URLs from **clipboard**
- Auto-update `yt-dlp` on startup
- **Dark / Light theme** toggle
- **Download history** — replay URLs or clear history
- **CLI mode** — use from terminal without GUI
- **Auto-update** — checks for new app versions on startup

## Screenshot

```
┌──────────────────────────────────────────────────┐
│  Riplet                                       │
│  YouTube URL: [_____________________________]    │
│  Save To:     [/path] [Browse]                   │
│  Download Type: [Audio ▼]                        │
│  [Download] [Cancel]                             │
│  Status: Idle                                    │
│  [████████████░░░░░░░░░░] 45.2%                  │
│  [Log output area]                               │
└──────────────────────────────────────────────────┘
```

## Installation

### Option 1: pip (all platforms)

```bash
pip install riplet
```

Then run:

```bash
# GUI mode
riplet

# CLI mode
riplet "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
```

### Option 2: From source (all platforms)

```bash
git clone https://github.com/Lervez5/Riplet.git
cd Riplet
python3 -m venv venv

# Windows:
venv\Scripts\activate

# Linux / macOS:
source venv/bin/activate

pip install -r requirements.txt
python downloader.py
```

### Option 3: Standalone executable (no Python needed)

**Linux / macOS:**

```bash
python build_exe.py
# Output: dist/Riplet
```

**Windows:**

```cmd
python build_exe.py
# Output: dist\Riplet.exe
```

Or use the launcher:

```cmd
run.bat
```

## Requirements

- Python 3.9+ (for source/pip install)
- `ffmpeg` (required for merging video+audio; auto-downloaded during standalone build)
- `python3-tk` (GUI only, included with most Python installs)
- `python3-secretstorage` + `gnome-keyring`/`kwallet` (browser cookies on Linux, GUI only)

### Platform-specific system packages

**Linux (Debian/Ubuntu):**

```bash
sudo apt install python3-tk ffmpeg python3-secretstorage gnome-keyring
```

**macOS:**

```bash
brew install ffmpeg python-tk
```

**Windows:**
Install [ffmpeg](https://ffmpeg.org/download.html) and add it to your PATH, or use the standalone executable which bundles ffmpeg automatically.

## Usage

### GUI Mode

Run with no arguments:

```bash
riplet
python downloader.py
```

1. Paste a YouTube URL (auto-detected from clipboard).
2. Choose **Audio** or **Video**.
3. Pick a **quality** (4K, 1080p, 720p, etc.).
4. Optionally enable **Playlist mode** and click **Fetch Playlist**.
5. Pick an output folder.
6. Click **Download**.
7. Use **History** to replay past downloads.

### CLI Mode

```bash
# Basic audio download
riplet "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

# Download video in 1080p
riplet "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --type Video --quality 1080p --outdir ~/Videos

# Download specific playlist items
riplet "https://www.youtube.com/playlist?list=xyz" --playlist-items 1,2,3 --subtitles --subtitle-lang en --subtitle-fmt srt

# Download full playlist
riplet "https://www.youtube.com/playlist?list=xyz" --playlist --subtitles --subtitle-lang en --subtitle-fmt srt

# Force GUI
riplet --gui
```

### CLI Arguments

```
positional arguments:
  url                   YouTube URL

options:
  --type {Audio,Video}  Download type (default: Audio)
  --quality {best,1080p,720p,480p,4k,audio}
                        Quality preset (default: best)
  --outdir              Output directory (default: ~/Downloads/YouTube_Downloads)
  --browser             Browser for cookies (default: chrome)
  --playlist            Download full playlist
  --playlist-items PLAYLIST_ITEMS
                        Comma-separated playlist item indices to download (e.g., 1,2,3)
  --subtitles           Download subtitles
  --subtitle-lang       Subtitle language (default: en)
  --subtitle-fmt        Subtitle format (default: srt)
  --gui                 Force GUI mode
  --check-update        Check for updates and exit
  --version             Show version
```

## Distribution

### PyPI

```bash
python -m build
python -m twine upload dist/*
```

Users install with:

```bash
pip install riplet
```

### Standalone Executables

Build for your current platform:

```bash
python build_exe.py
```

Output: `dist/Riplet` (Linux/macOS) or `dist\Riplet.exe` (Windows)

The build script automatically:

- Installs PyInstaller if needed
- Downloads ffmpeg for your platform
- Bundles everything into a single executable

**To distribute:**

- Share the executable from `dist/`
- Windows: `.exe` file
- macOS: `.app` or binary (may need codesigning for Gatekeeper)
- Linux: ELF binary (build on oldest target distro for compatibility)

### Auto-Updates

The app checks for updates on startup by comparing local `VERSION` against `UPDATE_URL`. When an update is available, it prints the download link.

- **pip users:** `pip install -U riplet`
- **standalone users:** download the new executable from the latest releases

## Running Tests

```bash
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt
python -m pytest tests/ -v
```

## License

MIT
