Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-video-cli

A production-quality Rust CLI for handling website login flows, detecting video players, intercepting streams, and downloading videos using ffmpeg.

This project is being built iteratively as a learning exercise, following modern Rust best practices (clap, thiserror, tracing, clean architecture, testing, and clippy).

Current Features

  • Clean command-line interface powered by clap
  • Reusable HttpClient module featuring:
    • Automatic cookie/session handling
    • Custom default headers support
    • GET and POST methods
    • Proxy support (for debugging with mitmproxy)
  • Structured logging using tracing
  • Proper error handling with thiserror
  • Modular and testable project structure

Usage

# Show help
cargo run -- --help

# Run with debug output
cargo run -- --debug

Development Setup (Windows + WSL + VS Code)

This project is developed inside WSL2 (Ubuntu) for Linux compatibility.

Prerequisites

Setup Steps

# 1. Install WSL2 (run in PowerShell as Administrator)
wsl --install

# 2. Open Ubuntu and install required build tools
sudo apt update && sudo apt install build-essential -y

# 3. Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"

# 4. Clone the project
git clone https://github.com/diechtiar/rust-video-cli.git
cd rust-video-cli

# 5. Open the project in VS Code (from WSL)
code .

Recommended VS Code Settings

Create .vscode/settings.json:

{
  "editor.formatOnSave": true,
  "[rust]": {
    "editor.defaultFormatter": "rust-lang.rust-analyzer"
  },
  "rust-analyzer.check.command": "clippy",
  "rust-analyzer.checkOnSave": true
}

Useful Commands

cargo check
cargo fmt
cargo clippy
cargo test
cargo run -- --help
cargo run -- --debug

Notes

Note on Browser Automation: When using browser-based features, Chrome will be automatically downloaded into the .chrome folder if not present on the system. You can run with a visible browser window during development for easier debugging.

Debugging & Traffic Inspection

You can route all HTTP/HTTPS traffic through mitmproxy for inspection:

HTTP_PROXY=http://127.0.0.1:8080 HTTPS_PROXY=http://127.0.0.1:8080 cargo run -- --debug

Note: You may need to run mitmproxy with .danger_accept_invalid_certs(true) temporarily during development.

Browser Automation

For websites protected by Cloudflare or that rely heavily on JavaScript (such as login flows), this project uses browser automation powered by chromiumoxide.

  • Automatically downloads and manages a Chrome instance if none is found
  • Enables realistic login flows that can handle CSRF tokens and JavaScript-rendered pages
  • Supports both headed mode (visible browser window) for debugging and headless mode
  • Currently used as the primary method for authentication flows

License

This project is licensed under the MIT License — see the LICENSE file for details.

Copyright (c) 2026 Wojciech Diechtiar

About

Production-quality Rust CLI for website login flows, video player detection, stream interception, and ffmpeg downloads. Built iteratively as a modern Rust learning project following best practices (clap, thiserror, tracing, tests, clippy).

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages