mirror of
https://framagit.org/veretcle/tootube.git
synced 2025-07-20 20:41:17 +02:00
Initial commit
This commit is contained in:
17
src/lib.rs
Normal file
17
src/lib.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
mod config;
|
||||
pub use config::parse_toml;
|
||||
use config::Config;
|
||||
|
||||
mod peertube;
|
||||
use peertube::{get_latest_video, get_max_resolution_dl};
|
||||
|
||||
pub fn run(config: Config) {
|
||||
// Get the latest video object
|
||||
let latest_vid = get_latest_video(&config.peertube.base_url).unwrap_or_else(|e| {
|
||||
panic!("Cannot retrieve the latest video, something must have gone terribly wrong: {e}")
|
||||
});
|
||||
|
||||
let dl_url = get_max_resolution_dl(&latest_vid.streaming_playlists.unwrap());
|
||||
|
||||
println!("{dl_url}");
|
||||
}
|
Reference in New Issue
Block a user