This commit is contained in:
Simon
2025-08-10 15:32:41 +00:00
parent 673458b630
commit 944746bf12
6 changed files with 298 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
use std::vec;
use std::{fs, vec};
use error_chain::error_chain;
use futures::future::join_all;
use serde_json::error::Category;
@@ -44,7 +44,13 @@ impl Provider for AllProvider {
) -> Vec<VideoItem> {
let mut sites_str = options.clone().sites.unwrap();
if sites_str.is_empty() {
sites_str = "perverzija,hanime,spankbang,pmvhaven,redtube,pornhub,rule34video".to_string();
let files = fs::read_dir("./src/providers").unwrap();
let providers = files.map(|entry| entry.unwrap().file_name())
.filter(|name| name.to_str().unwrap().ends_with(".rs"))
.filter(|name| !name.to_str().unwrap().contains("mod.rs") && !name.to_str().unwrap().contains("all.rs"))
.map(|name| name.to_str().unwrap().replace(".rs", ""))
.collect::<Vec<String>>();
sites_str = providers.join(",");
}
let sites = sites_str
.split(',')