initial commit

This commit is contained in:
yggverse 2025-06-07 12:28:02 +03:00
parent 9fcd892d42
commit d55c642eb6
11 changed files with 305 additions and 1 deletions

13
src/api.rs Normal file
View file

@ -0,0 +1,13 @@
/// Parse infohash from the source filepath,
/// decode JSON to array on success
pub fn infohashes(path: &str) -> anyhow::Result<Vec<String>> {
let mut f = std::fs::File::open(path)?;
let mut s = String::new();
use std::io::Read;
f.read_to_string(&mut s)?;
let r: Vec<String> = serde_json::from_str(&s)?;
Ok(r)
}