implemented spankbang
This commit is contained in:
118
src/api.rs
118
src/api.rs
@@ -4,6 +4,7 @@ use ntex::web::HttpRequest;
|
||||
|
||||
use crate::providers::hanime::HanimeProvider;
|
||||
use crate::providers::perverzija::PerverzijaProvider;
|
||||
use crate::providers::spankbang::SpankbangProvider;
|
||||
use crate::util::cache::VideoCache;
|
||||
use crate::{providers::*, status::*, videos::*, DbPool};
|
||||
|
||||
@@ -28,89 +29,6 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
||||
.unwrap_or_default()
|
||||
.to_string();
|
||||
let mut status = Status::new();
|
||||
|
||||
// You can now use `method`, `host`, and `port` as needed
|
||||
|
||||
// status.add_channel(Channel {
|
||||
// id: "all".to_string(),
|
||||
// name: "SpaceMoehre's Hottub".to_string(),
|
||||
// favicon: format!("http://{}/static/favicon.ico", host).to_string(),
|
||||
// premium: false,
|
||||
// description: "Work in Progress".to_string(),
|
||||
// status: "active".to_string(),
|
||||
// categories: vec![],
|
||||
// options: vec![
|
||||
// ChannelOption {
|
||||
// id: "channels".to_string(),
|
||||
// title: "Sites".to_string(),
|
||||
// description: "Websites included in search results.".to_string(),
|
||||
// systemImage: "network".to_string(),
|
||||
// colorName: "purple".to_string(),
|
||||
// options: vec![
|
||||
// FilterOption {
|
||||
// id: "perverzija".to_string(),
|
||||
// title: "Perverzija".to_string(),
|
||||
// },
|
||||
// ],
|
||||
// multiSelect: true,
|
||||
// },
|
||||
// ChannelOption {
|
||||
// id: "sort".to_string(),
|
||||
// title: "Sort".to_string(),
|
||||
// description: "Sort the Videos".to_string(), //"Sort the videos by Date or Name.".to_string(),
|
||||
// systemImage: "list.number".to_string(),
|
||||
// colorName: "blue".to_string(),
|
||||
// options: vec![
|
||||
// FilterOption {
|
||||
// id: "date".to_string(),
|
||||
// title: "Date".to_string(),
|
||||
// },
|
||||
// FilterOption {
|
||||
// id: "name".to_string(),
|
||||
// title: "Name".to_string(),
|
||||
// },
|
||||
// ],
|
||||
// multiSelect: false,
|
||||
// },
|
||||
// ChannelOption {
|
||||
// id: "duration".to_string(),
|
||||
// title: "Duration".to_string(),
|
||||
// description: "Filter the videos by duration.".to_string(),
|
||||
// systemImage: "timer".to_string(),
|
||||
// colorName: "green".to_string(),
|
||||
// options: vec![
|
||||
// FilterOption {
|
||||
// id: "short".to_string(),
|
||||
// title: "< 1h".to_string(),
|
||||
// },
|
||||
// FilterOption {
|
||||
// id: "long".to_string(),
|
||||
// title: "> 1h".to_string(),
|
||||
// },
|
||||
// ],
|
||||
// multiSelect: true,
|
||||
// },
|
||||
// ChannelOption {
|
||||
// id: "featured".to_string(),
|
||||
// title: "Featured".to_string(),
|
||||
// description: "Filter Featured Videos.".to_string(),
|
||||
// systemImage: "star".to_string(),
|
||||
// colorName: "red".to_string(),
|
||||
// options: vec![
|
||||
// FilterOption {
|
||||
// id: "all".to_string(),
|
||||
// title: "No".to_string(),
|
||||
// },
|
||||
// FilterOption {
|
||||
// id: "featured".to_string(),
|
||||
// title: "Yes".to_string(),
|
||||
// },
|
||||
// ],
|
||||
// multiSelect: false,
|
||||
// },
|
||||
// ],
|
||||
// nsfw: true,
|
||||
// });
|
||||
status.add_channel(Channel {
|
||||
id: "perverzija".to_string(),
|
||||
name: "Perverzija".to_string(),
|
||||
@@ -239,6 +157,39 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
||||
],
|
||||
nsfw: true,
|
||||
});
|
||||
status.add_channel(Channel {
|
||||
id: "spankbang".to_string(),
|
||||
name: "SpankBang".to_string(),
|
||||
description: "Popular Porn Videos - SpankBang".to_string(),
|
||||
premium: false,
|
||||
favicon: "https://www.google.com/s2/favicons?sz=64&domain=spankbang.com".to_string(),
|
||||
status: "active".to_string(),
|
||||
categories: vec![],
|
||||
options: vec![
|
||||
ChannelOption{
|
||||
id: "sort".to_string(),
|
||||
title: "Sort".to_string(),
|
||||
description: "Sort the Videos".to_string(), //"Sort the videos by Date or Name.".to_string(),
|
||||
systemImage: "list.number".to_string(),
|
||||
colorName: "blue".to_string(),
|
||||
options: vec![
|
||||
FilterOption {
|
||||
id: "trending_videos".to_string(),
|
||||
title: "Trending".to_string(),
|
||||
},
|
||||
FilterOption {
|
||||
id: "new_videos".to_string(),
|
||||
title: "New".to_string(),
|
||||
},
|
||||
FilterOption {
|
||||
id: "most_popular".to_string(),
|
||||
title: "Popular".to_string(),
|
||||
}],
|
||||
multiSelect: false,
|
||||
}
|
||||
],
|
||||
nsfw: true,
|
||||
});
|
||||
status.iconUrl = format!("http://{}/favicon.ico", host).to_string();
|
||||
Ok(web::HttpResponse::Ok().json(&status))
|
||||
}
|
||||
@@ -293,6 +244,7 @@ pub fn get_provider(channel: &str) -> Option<AnyProvider> {
|
||||
match channel {
|
||||
"perverzija" => Some(AnyProvider::Perverzija(PerverzijaProvider::new())),
|
||||
"hanime" => Some(AnyProvider::Hanime(HanimeProvider::new())),
|
||||
"spankbang" => Some(AnyProvider::Spankbang(SpankbangProvider::new())),
|
||||
_ => Some(AnyProvider::Perverzija(PerverzijaProvider::new())),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user