manifest: official addons retrieved
@@ -40,14 +40,19 @@ mod tests {
},
100,
);
- println!("{:?}", get_addons());
+ let addons_resp = get_addons("https://api.strem.io/addonsofficialcollection.json").unwrap();
+ let catalogs: Vec<&ManifestCatalog> = addons_resp.iter()
+ .map(|a| &a.manifest.catalogs)
+ .flatten()
+ .collect();
+ println!("{:?}", catalogs);
//println!("{:?}", container.get_state());
//println!("{}", serde_json::to_string(&state).expect("rip"));
//assert_eq!(2 + 2, 4);
}
- fn get_addons() -> reqwest::Result<Vec<AddonDescriptor>> {
- Ok(reqwest::get("https://api.strem.io/addonscollection.json")?.json()?)
+ fn get_addons(url: &'static str) -> reqwest::Result<Vec<AddonDescriptor>> {
+ Ok(reqwest::get(url)?.json()?)
}
fn get_cinemeta() -> reqwest::Result<CatalogResponse> {
Ok(reqwest::get("https://v3-cinemeta.strem.io/catalog/movie/top.json")?.json()?)
