| Crates.io | riva |
| lib.rs | riva |
| version | 0.1.0 |
| created_at | 2025-12-06 12:56:15.981743+00 |
| updated_at | 2025-12-06 12:56:15.981743+00 |
| description | Provider-agnostic Rust library for extracting normalized media stream metadata from SoundCloud and YouTube via async helpers. |
| homepage | https://github.com/resonix-dev/riva |
| repository | https://github.com/resonix-dev/riva |
| max_upload_size | |
| id | 1970127 |
| size | 94,889 |
Riva is a provider-agnostic media stream metadata extractor written in Rust. It ships with first-class support for SoundCloud and YouTube and exposes ergonomic helpers so you can build downloaders, previewers, or stream routers without babysitting ever-changing web APIs.
soundcloud, youtube).reqwest and tokio so you can integrate into any modern async application.tests/ cover URL normalization and extractor helpers.example/ contains a miniature CLI showing how to list all SoundCloud streams for a track.cargo (bundled with Rustup)Add Riva to your project with the providers you need:
cargo add riva --features youtube,soundcloud
Disable providers you do not plan to use:
cargo add riva --no-default-features --features youtube
use riva::soundcloud::{extract_streams, StreamInfo};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let track_url = "https://soundcloud.com/kordhell/trageluxe";
let streams: Vec<StreamInfo> = extract_streams(track_url).await?;
for stream in streams {
println!("{} {}", stream.protocol, stream.mime_type);
println!(" URL: {}", stream.url);
}
Ok(())
}
An executable example that mirrors this snippet lives in example/src/main.rs and can be executed via:
cargo run --example riva-test -- https://soundcloud.com/kordhell/trageluxe
| Provider | Feature flag | Normalization helper | Notes |
|---|---|---|---|
| SoundCloud | soundcloud |
riva::soundcloud::normalize_track_url |
Discovers client IDs automatically and filters unsupported transcodings. |
| YouTube | youtube |
riva::youtube::normalize_video_id |
Uses the lightweight mobile API and filters inaccessible streams. |
The repository ships with a deterministic testing bench that avoids hitting live provider APIs:
tests/normalization.rs validates public normalization helpers for both providers.Run the entire suite locally with:
cargo test
CI runs cargo fmt --check, cargo clippy -- -D warnings, and cargo test on every pull request to ensure the testing bench stays green.
src/
providers/
soundcloud/ # SoundCloud extractor, models, and URL normalization
youtube/ # YouTube extractor, models, and helpers
example/
src/main.rs # Minimal binary for manual experiments
See CONTRIBUTING.md for detailed guidelines, coding standards, and the review checklist. By participating you agree to abide by the CODE_OF_CONDUCT.md.
Security disclosures should follow the process documented in SECURITY.md. Please avoid filing public issues for vulnerabilities.
Distributed under the terms of the MIT License. See LICENSE for details.