adaptions format for paradise hill
This commit is contained in:
13
src/api.rs
13
src/api.rs
@@ -819,19 +819,10 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
name: "Paradisehill".to_string(),
|
name: "Paradisehill".to_string(),
|
||||||
description: "Porn Movies on Paradise Hill".to_string(),
|
description: "Porn Movies on Paradise Hill".to_string(),
|
||||||
premium: false,
|
premium: false,
|
||||||
favicon: "https://en.paradisehill.cc/img/big-logo.svg".to_string(),
|
favicon: "https://www.google.com/s2/favicons?sz=64&domain=en.paradisehill.cc".to_string(),
|
||||||
status: "active".to_string(),
|
status: "active".to_string(),
|
||||||
categories: vec![],
|
categories: vec![],
|
||||||
options: vec![ChannelOption {
|
options: vec![],
|
||||||
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![
|
|
||||||
],
|
|
||||||
multiSelect: false,
|
|
||||||
}],
|
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: None,
|
cacheDuration: None,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use htmlentity::entity::{decode, ICodedDataTrait};
|
|||||||
use futures::future::join_all;
|
use futures::future::join_all;
|
||||||
use crate::providers::Provider;
|
use crate::providers::Provider;
|
||||||
use crate::util::cache::VideoCache;
|
use crate::util::cache::VideoCache;
|
||||||
use crate::videos::ServerOptions;
|
use crate::videos::{self, ServerOptions};
|
||||||
use crate::videos::{VideoItem};
|
use crate::videos::{VideoItem};
|
||||||
use crate::DbPool;
|
use crate::DbPool;
|
||||||
use crate::util::requester::Requester;
|
use crate::util::requester::Requester;
|
||||||
@@ -145,15 +145,22 @@ impl ParadisehillProvider {
|
|||||||
.split("\"").collect::<Vec<&str>>()[0].replace("\\", "").to_string();
|
.split("\"").collect::<Vec<&str>>()[0].replace("\\", "").to_string();
|
||||||
let id = video_url.split("/").collect::<Vec<&str>>().last().unwrap().split("_").collect::<Vec<&str>>()[0]
|
let id = video_url.split("/").collect::<Vec<&str>>().last().unwrap().split("_").collect::<Vec<&str>>()[0]
|
||||||
.to_string();
|
.to_string();
|
||||||
|
|
||||||
|
let format = videos::VideoFormat::new(video_url.clone(), "1080".to_string(), "mp4".to_string())
|
||||||
|
.protocol("https".to_string())
|
||||||
|
.format_id("mp4-1080")
|
||||||
|
;
|
||||||
|
|
||||||
let video_item = VideoItem::new(
|
let video_item = VideoItem::new(
|
||||||
id,
|
id,
|
||||||
title,
|
title,
|
||||||
video_url.clone(),
|
url_str.clone(),
|
||||||
"paradisehill".to_string(),
|
"paradisehill".to_string(),
|
||||||
thumb,
|
thumb,
|
||||||
0,
|
0,
|
||||||
)
|
)
|
||||||
.aspect_ratio(0.697674419 as f32)
|
.aspect_ratio(0.697674419 as f32)
|
||||||
|
.formats(vec![format])
|
||||||
;
|
;
|
||||||
|
|
||||||
return Ok(video_item);
|
return Ok(video_item);
|
||||||
|
|||||||
157
src/videos.rs
157
src/videos.rs
@@ -2,8 +2,6 @@ use std::collections::HashMap;
|
|||||||
|
|
||||||
use crate::util::requester::Requester;
|
use crate::util::requester::Requester;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize, Debug)]
|
#[derive(serde::Serialize, serde::Deserialize, Debug)]
|
||||||
pub struct VideosRequest {
|
pub struct VideosRequest {
|
||||||
//"versionInstallDate":"2025-06-03T18:20:20Z","languageCode":"en","appInstallDate":"2025-06-03T18:20:20Z","server":"spacemoehre","sexu
|
//"versionInstallDate":"2025-06-03T18:20:20Z","languageCode":"en","appInstallDate":"2025-06-03T18:20:20Z","server":"spacemoehre","sexu
|
||||||
@@ -11,37 +9,37 @@ pub struct VideosRequest {
|
|||||||
pub blockedKeywords: Option<String>, // "kittens",
|
pub blockedKeywords: Option<String>, // "kittens",
|
||||||
pub countryCode: Option<String>, // "DE",
|
pub countryCode: Option<String>, // "DE",
|
||||||
pub clientVersion: Option<String>, // "2.1.4-22b",
|
pub clientVersion: Option<String>, // "2.1.4-22b",
|
||||||
pub timestamp: Option<String>, // "1748976686",
|
pub timestamp: Option<String>, // "1748976686",
|
||||||
pub blockedUploaders: Option<String>, // "",
|
pub blockedUploaders: Option<String>, // "",
|
||||||
pub anonId: Option<String>, // "1AB8A060-A47D-47EF-B9CB-63980ED84C8A",
|
pub anonId: Option<String>, // "1AB8A060-A47D-47EF-B9CB-63980ED84C8A",
|
||||||
pub debugTools: Option<bool>, // false,
|
pub debugTools: Option<bool>, // false,
|
||||||
pub versionInstallDate: Option<String>, // "2025-06-03T18:20:20Z",
|
pub versionInstallDate: Option<String>, // "2025-06-03T18:20:20Z",
|
||||||
pub languageCode: Option<String>, // "en",
|
pub languageCode: Option<String>, // "en",
|
||||||
pub appInstallDate: Option<String>, // "2025-06-03T18:20:20Z",
|
pub appInstallDate: Option<String>, // "2025-06-03T18:20:20Z",
|
||||||
pub server: Option<String>, // "spacemoehre",
|
pub server: Option<String>, // "spacemoehre",
|
||||||
pub sexuality: Option<String>, // "straight",
|
pub sexuality: Option<String>, // "straight",
|
||||||
pub channel: Option<String>, //"youtube",
|
pub channel: Option<String>, //"youtube",
|
||||||
pub sort: Option<String>, //"new",
|
pub sort: Option<String>, //"new",
|
||||||
pub query: Option<String>, //"kittens",
|
pub query: Option<String>, //"kittens",
|
||||||
pub page: Option<String>, //1,
|
pub page: Option<String>, //1,
|
||||||
pub perPage: Option<String>, //10,
|
pub perPage: Option<String>, //10,
|
||||||
// Your server's global options will be sent in the videos request
|
// Your server's global options will be sent in the videos request
|
||||||
// pub flavor: "mint chocolate chip"
|
// pub flavor: "mint chocolate chip"
|
||||||
pub featured: Option<String>, // "featured",
|
pub featured: Option<String>, // "featured",
|
||||||
pub category: Option<String>, // "pmv"
|
pub category: Option<String>, // "pmv"
|
||||||
pub sites: Option<String>, //
|
pub sites: Option<String>, //
|
||||||
pub filter: Option<String>, //
|
pub filter: Option<String>, //
|
||||||
pub language: Option<String>, //
|
pub language: Option<String>, //
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
|
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
|
||||||
pub struct ServerOptions{
|
pub struct ServerOptions {
|
||||||
pub featured: Option<String>, // "featured",
|
pub featured: Option<String>, // "featured",
|
||||||
pub category: Option<String>, // "pmv"
|
pub category: Option<String>, // "pmv"
|
||||||
pub sites: Option<String>, //
|
pub sites: Option<String>, //
|
||||||
pub filter: Option<String>,
|
pub filter: Option<String>,
|
||||||
pub language: Option<String>, // "en"
|
pub language: Option<String>, // "en"
|
||||||
pub requester: Option<Requester>
|
pub requester: Option<Requester>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(serde::Serialize, Debug)]
|
#[derive(serde::Serialize, Debug)]
|
||||||
@@ -50,30 +48,26 @@ pub struct PageInfo {
|
|||||||
pub resultsPerPage: u32, // 10
|
pub resultsPerPage: u32, // 10
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
|
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
|
||||||
pub struct VideoEmbed{
|
pub struct VideoEmbed {
|
||||||
pub html: String,
|
pub html: String,
|
||||||
pub source: String,
|
pub source: String,
|
||||||
}
|
}
|
||||||
impl VideoEmbed {
|
impl VideoEmbed {
|
||||||
pub fn new(html: String, source: String) -> Self {
|
pub fn new(html: String, source: String) -> Self {
|
||||||
VideoEmbed {
|
VideoEmbed { html, source }
|
||||||
html,
|
|
||||||
source,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
|
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
|
||||||
pub struct VideoItem {
|
pub struct VideoItem {
|
||||||
pub duration: u32, // 110,
|
pub duration: u32, // 110,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub views: Option<u32>, // 14622653,
|
pub views: Option<u32>, // 14622653,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub rating: Option<f32>, // 0.0,
|
pub rating: Option<f32>, // 0.0,
|
||||||
pub id: String, // "c85017ca87477168d648727753c4ded8a35f173e22ef93743e707b296becb299",
|
pub id: String, // "c85017ca87477168d648727753c4ded8a35f173e22ef93743e707b296becb299",
|
||||||
pub title: String, // "20 Minutes of Adorable Kittens BEST Compilation",
|
pub title: String, // "20 Minutes of Adorable Kittens BEST Compilation",
|
||||||
pub url: String, // "https://www.youtube.com/watch?v=y0sF5xhGreA",
|
pub url: String, // "https://www.youtube.com/watch?v=y0sF5xhGreA",
|
||||||
pub channel: String, // "youtube",
|
pub channel: String, // "youtube",
|
||||||
pub thumb: String, // "https://i.ytimg.com/vi/y0sF5xhGreA/hqdefault.jpg",
|
pub thumb: String, // "https://i.ytimg.com/vi/y0sF5xhGreA/hqdefault.jpg",
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
@@ -93,7 +87,7 @@ pub struct VideoItem {
|
|||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub preview: Option<String>,
|
pub preview: Option<String>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub aspectRation: Option<f32>
|
pub aspectRation: Option<f32>,
|
||||||
}
|
}
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
impl VideoItem {
|
impl VideoItem {
|
||||||
@@ -106,9 +100,9 @@ impl VideoItem {
|
|||||||
duration: u32,
|
duration: u32,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
VideoItem {
|
VideoItem {
|
||||||
duration: duration, // Placeholder, adjust as needed
|
duration: duration, // Placeholder, adjust as needed
|
||||||
views: None, // Placeholder, adjust as needed
|
views: None, // Placeholder, adjust as needed
|
||||||
rating: None, // Placeholder, adjust as needed
|
rating: None, // Placeholder, adjust as needed
|
||||||
id,
|
id,
|
||||||
title,
|
title,
|
||||||
url,
|
url,
|
||||||
@@ -120,9 +114,9 @@ impl VideoItem {
|
|||||||
tags: None, // Placeholder, adjust as needed
|
tags: None, // Placeholder, adjust as needed
|
||||||
uploadedAt: None,
|
uploadedAt: None,
|
||||||
formats: None, // Placeholder for formats
|
formats: None, // Placeholder for formats
|
||||||
embed: None, // Placeholder for embed information
|
embed: None, // Placeholder for embed information
|
||||||
preview: None,
|
preview: None,
|
||||||
aspectRation: None
|
aspectRation: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn tags(mut self, tags: Vec<String>) -> Self {
|
pub fn tags(mut self, tags: Vec<String>) -> Self {
|
||||||
@@ -157,7 +151,7 @@ impl VideoItem {
|
|||||||
self.formats = Some(formats);
|
self.formats = Some(formats);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
pub fn add_format(mut self, format: VideoFormat){
|
pub fn add_format(mut self, format: VideoFormat) {
|
||||||
if let Some(formats) = self.formats.as_mut() {
|
if let Some(formats) = self.formats.as_mut() {
|
||||||
formats.push(format);
|
formats.push(format);
|
||||||
} else {
|
} else {
|
||||||
@@ -228,7 +222,6 @@ pub struct VideoFormat {
|
|||||||
resolution: Option<String>,
|
resolution: Option<String>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
http_headers: Option<HashMap<String, String>>,
|
http_headers: Option<HashMap<String, String>>,
|
||||||
|
|
||||||
}
|
}
|
||||||
impl VideoFormat {
|
impl VideoFormat {
|
||||||
pub fn new(url: String, quality: String, format: String) -> Self {
|
pub fn new(url: String, quality: String, format: String) -> Self {
|
||||||
@@ -269,6 +262,94 @@ impl VideoFormat {
|
|||||||
headers.insert(key, value);
|
headers.insert(key, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
pub fn format_id(mut self, format_id: String) -> Self {
|
||||||
|
self.format_id = Some(format_id);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn format_note(mut self, format_note: String) -> Self {
|
||||||
|
self.format_note = Some(format_note);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn filesize(mut self, filesize: u32) -> Self {
|
||||||
|
self.filesize = Some(filesize);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn asr(mut self, asr: u32) -> Self {
|
||||||
|
self.asr = Some(asr);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn fps(mut self, fps: u32) -> Self {
|
||||||
|
self.fps = Some(fps);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn width(mut self, width: u32) -> Self {
|
||||||
|
self.width = Some(width);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn height(mut self, height: u32) -> Self {
|
||||||
|
self.height = Some(height);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn tbr(mut self, tbr: u32) -> Self {
|
||||||
|
self.tbr = Some(tbr);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn language(mut self, language: String) -> Self {
|
||||||
|
self.language = Some(language);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn language_preference(mut self, language_preference: u32) -> Self {
|
||||||
|
self.language_preference = Some(language_preference);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn ext(mut self, ext: String) -> Self {
|
||||||
|
self.ext = Some(ext);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn vcodec(mut self, vcodec: String) -> Self {
|
||||||
|
self.vcodec = Some(vcodec);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn acodec(mut self, acodec: String) -> Self {
|
||||||
|
self.acodec = Some(acodec);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn dynamic_range(mut self, dynamic_range: String) -> Self {
|
||||||
|
self.dynamic_range = Some(dynamic_range);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn abr(mut self, abr: u32) -> Self {
|
||||||
|
self.abr = Some(abr);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn vbr(mut self, vbr: u32) -> Self {
|
||||||
|
self.vbr = Some(vbr);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn container(mut self, container: String) -> Self {
|
||||||
|
self.container = Some(container);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn protocol(mut self, protocol: String) -> Self {
|
||||||
|
self.protocol = Some(protocol);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn audio_ext(mut self, audio_ext: String) -> Self {
|
||||||
|
self.audio_ext = Some(audio_ext);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn video_ext(mut self, video_ext: String) -> Self {
|
||||||
|
self.video_ext = Some(video_ext);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn resolution(mut self, resolution: String) -> Self {
|
||||||
|
self.resolution = Some(resolution);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
pub fn http_headers(mut self, http_headers: HashMap<String, String>) -> Self {
|
||||||
|
self.http_headers = Some(http_headers);
|
||||||
|
self
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#[derive(serde::Serialize, Debug)]
|
#[derive(serde::Serialize, Debug)]
|
||||||
pub struct Videos {
|
pub struct Videos {
|
||||||
|
|||||||
Reference in New Issue
Block a user