crispy_stalker/lib.rs
1//! Async Stalker/MAG portal API client.
2//!
3//! This crate implements the Stalker middleware portal protocol, a legacy
4//! query-string-based API used by MAG set-top-box portals. It handles
5//! portal discovery, MAC-based authentication, paginated data fetching,
6//! and stream URL resolution.
7//!
8//! # Usage
9//!
10//! ```no_run
11//! use crispy_stalker::{StalkerClient, StalkerCredentials};
12//!
13//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
14//! let creds = StalkerCredentials {
15//! base_url: "http://portal.example.com".into(),
16//! mac_address: "00:1A:79:AB:CD:EF".into(),
17//! timezone: None,
18//! };
19//!
20//! let mut client = StalkerClient::new(creds, false)?;
21//! client.authenticate().await?;
22//!
23//! let genres = client.get_genres().await?;
24//! for genre in &genres {
25//! let channels = client.get_all_channels(&genre.id, None).await?;
26//! println!("{}: {} channels", genre.title, channels.len());
27//! }
28//! # Ok(())
29//! # }
30//! ```
31
32pub mod backoff;
33pub mod client;
34pub mod device;
35pub mod discovery;
36pub mod error;
37pub mod session;
38pub mod types;
39pub mod url;
40
41pub use backoff::BackoffConfig;
42pub use client::StalkerClient;
43pub use error::StalkerError;
44pub use session::StalkerSession;
45pub use types::{
46 PaginatedResult, StalkerAccountInfo, StalkerCategory, StalkerChannel, StalkerCredentials,
47 StalkerEpgEntry, StalkerEpisode, StalkerProfile, StalkerSeason, StalkerSeriesDetail,
48 StalkerSeriesItem, StalkerVodItem,
49};
50pub use url::resolve_stream_url;