Skip to main content

bgutil_ytdlp_pot_provider/
lib.rs

1//! BgUtils POT Provider - Rust Implementation
2//!
3//! A high-performance proof-of-origin token (POT) provider for yt-dlp using the rustypipe-botguard crate.
4//! This library provides both HTTP server and script-based modes for generating authentic POT tokens
5//! to bypass YouTube's bot detection.
6//!
7//! # Features
8//!
9//! - **Real BotGuard Integration**: Uses rustypipe-botguard for authentic POT token generation
10//! - **High Performance**: Written in Rust for optimal speed and memory efficiency
11//! - **HTTP Server Mode**: Always-running REST API for token generation
12//! - **Script Mode**: Command-line interface for single token requests
13//! - **Session Management**: Intelligent caching and session handling
14//! - **Cross-Platform**: Native support for Linux, Windows, and macOS
15//!
16//! # Architecture
17//!
18//! The project consists of two main operation modes:
19//! - **HTTP Server Mode**: An always-running REST API service for token generation
20//! - **Script Mode**: A command-line tool for one-time token generation
21//!
22//! # Usage
23//!
24//! ## HTTP Server Mode
25//!
26//! ```bash
27//! bgutil-pot-server --port 4416 --host 0.0.0.0
28//! ```
29//!
30//! ## Script Mode
31//!
32//! ```bash
33//! bgutil-pot-generate --content-binding "video_id"
34//! ```
35//!
36//! # Examples
37//!
38//! ```rust
39//! use bgutil_ytdlp_pot_provider::{SessionManager, Settings};
40//!
41//! # async fn example() -> anyhow::Result<()> {
42//! let settings = Settings::default();
43//! let session_manager = SessionManager::new(settings);
44//! # Ok(())
45//! # }
46//! ```
47
48pub mod cli;
49pub mod config;
50pub mod error;
51#[cfg(feature = "ffi")]
52pub mod ffi;
53pub mod server;
54pub mod session;
55pub mod types;
56pub mod utils;
57
58pub use config::{ConfigLoader, Settings};
59pub use error::{Error, Result};
60pub use session::SessionManager;
61pub use types::{ErrorResponse, PingResponse, PotRequest, PotResponse};