Initial commit

This commit is contained in:
VC
2023-09-29 17:16:47 +02:00
commit 65cbb89eb5
7 changed files with 1350 additions and 0 deletions

17
src/lib.rs Normal file
View 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}");
}