sxyprn hotfix
This commit is contained in:
@@ -5,9 +5,9 @@ use crate::status::*;
|
|||||||
use crate::util::cache::VideoCache;
|
use crate::util::cache::VideoCache;
|
||||||
use crate::util::discord::format_error_chain;
|
use crate::util::discord::format_error_chain;
|
||||||
use crate::util::discord::send_discord_error_report;
|
use crate::util::discord::send_discord_error_report;
|
||||||
|
use crate::util::hoster_proxy::{proxy_name_for_url, rewrite_hoster_url};
|
||||||
use crate::util::requester::Requester;
|
use crate::util::requester::Requester;
|
||||||
use crate::util::time::parse_time_to_seconds;
|
use crate::util::time::parse_time_to_seconds;
|
||||||
use crate::util::hoster_proxy::{proxy_name_for_url, rewrite_hoster_url};
|
|
||||||
use crate::videos::ServerOptions;
|
use crate::videos::ServerOptions;
|
||||||
use crate::videos::VideoFormat;
|
use crate::videos::VideoFormat;
|
||||||
use crate::videos::VideoItem;
|
use crate::videos::VideoItem;
|
||||||
@@ -339,7 +339,6 @@ impl SxyprnProvider {
|
|||||||
.filter_map(|part| part.split("'").next().map(|u| u.to_string()))
|
.filter_map(|part| part.split("'").next().map(|u| u.to_string()))
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
|
||||||
let document = Html::parse_document(title_parts);
|
let document = Html::parse_document(title_parts);
|
||||||
let selector = Selector::parse("*")
|
let selector = Selector::parse("*")
|
||||||
.map_err(|e| ErrorKind::Parse(format!("selector parse failed: {e}")))?;
|
.map_err(|e| ErrorKind::Parse(format!("selector parse failed: {e}")))?;
|
||||||
@@ -477,42 +476,6 @@ impl SxyprnProvider {
|
|||||||
let mut formats = vec![];
|
let mut formats = vec![];
|
||||||
|
|
||||||
// Add sxyprn format
|
// Add sxyprn format
|
||||||
let sxyprn_url = format!(
|
|
||||||
"{}/proxy/sxyprn/post/{}",
|
|
||||||
options.public_url_base.as_deref().unwrap_or(""),
|
|
||||||
id
|
|
||||||
);
|
|
||||||
formats.push(
|
|
||||||
VideoFormat::new(sxyprn_url.clone(), "auto".to_string(), "mp4".to_string())
|
|
||||||
.format_note(
|
|
||||||
sxyprn_url
|
|
||||||
.split("/")
|
|
||||||
.nth(4)
|
|
||||||
.unwrap_or("sxyprn")
|
|
||||||
.to_string(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Also collect and transform vidara.so URLs to proxy format and add as formats
|
|
||||||
let vidara_urls: Vec<String> = title_links
|
|
||||||
.iter()
|
|
||||||
.filter(|url| proxy_name_for_url(url).as_deref() == Some("vidara"))
|
|
||||||
.map(|url| rewrite_hoster_url(options, url))
|
|
||||||
.collect();
|
|
||||||
|
|
||||||
for vidara_url in vidara_urls {
|
|
||||||
formats.push(
|
|
||||||
VideoFormat::m3u8(vidara_url.clone(), "1080".to_string(), "m3u8".to_string())
|
|
||||||
.format_note(
|
|
||||||
vidara_url
|
|
||||||
.split("/")
|
|
||||||
.nth(4)
|
|
||||||
.unwrap_or("vidara")
|
|
||||||
.to_string(),
|
|
||||||
)
|
|
||||||
.format_id("vidara".to_string()),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
let doodstream_urls: Vec<String> = title_links
|
let doodstream_urls: Vec<String> = title_links
|
||||||
.iter()
|
.iter()
|
||||||
@@ -536,13 +499,38 @@ impl SxyprnProvider {
|
|||||||
|
|
||||||
for lulustream_url in lulustream_urls {
|
for lulustream_url in lulustream_urls {
|
||||||
formats.push(
|
formats.push(
|
||||||
VideoFormat::m3u8(lulustream_url.clone(), "auto".to_string(), "m3u8".to_string())
|
VideoFormat::m3u8(
|
||||||
.format_note("lulustream".to_string())
|
lulustream_url.clone(),
|
||||||
.format_id("lulustream".to_string()),
|
"auto".to_string(),
|
||||||
|
"m3u8".to_string(),
|
||||||
|
)
|
||||||
|
.format_note("lulustream".to_string())
|
||||||
|
.format_id("lulustream".to_string()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
let sxyprn_url = format!(
|
||||||
|
"{}/proxy/sxyprn/post/{}",
|
||||||
|
options.public_url_base.as_deref().unwrap_or(""),
|
||||||
|
id
|
||||||
|
);
|
||||||
|
formats.push(
|
||||||
|
VideoFormat::new(sxyprn_url.clone(), "auto".to_string(), "mp4".to_string())
|
||||||
|
.format_note(sxyprn_url.split("/").nth(4).unwrap_or("sxyprn").to_string()),
|
||||||
|
);
|
||||||
|
// Also collect and transform vidara.so URLs to proxy format and add as formats
|
||||||
|
let vidara_urls: Vec<String> = title_links
|
||||||
|
.iter()
|
||||||
|
.filter(|url| proxy_name_for_url(url).as_deref() == Some("vidara"))
|
||||||
|
.map(|url| rewrite_hoster_url(options, url))
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
for vidara_url in vidara_urls {
|
||||||
|
formats.push(
|
||||||
|
VideoFormat::m3u8(vidara_url.clone(), "1080".to_string(), "m3u8".to_string())
|
||||||
|
.format_note(vidara_url.split("/").nth(4).unwrap_or("vidara").to_string())
|
||||||
|
.format_id("vidara".to_string()),
|
||||||
|
);
|
||||||
|
}
|
||||||
let mut video_item = VideoItem::new(
|
let mut video_item = VideoItem::new(
|
||||||
id.clone(),
|
id.clone(),
|
||||||
title,
|
title,
|
||||||
|
|||||||
Reference in New Issue
Block a user