sxyprn format changes vidara

This commit is contained in:
Simon
2026-05-05 19:11:26 +00:00
committed by ForgeCode
parent c4292c2ffc
commit 9e8f326518
2 changed files with 107 additions and 94 deletions

View File

@@ -442,13 +442,26 @@ impl SxyprnProvider {
let duration = parse_time_to_seconds(&raw_duration).unwrap_or(0) as u32;
// stream urls - collect both lulustream and vidara.so URLs
let mut stream_urls = vec![format!(
let mut formats = vec![];
// 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
// Also collect and transform vidara.so URLs to proxy format and add as formats
let vidara_urls: Vec<String> = video_segment
.split("extlink_icon extlink")
.filter_map(|part| {
@@ -469,21 +482,21 @@ impl SxyprnProvider {
})
.collect();
stream_urls.extend(vidara_urls);
let formats: Vec<VideoFormat> = stream_urls
.into_iter()
.map(|url| {
VideoFormat::new(url.clone(), "auto".to_string(), "mp4".to_string())
for vidara_url in vidara_urls {
formats.push(
VideoFormat::new(vidara_url.clone(), "1080".to_string(), "m3u8".to_string())
.format_note(
url.split("/")
vidara_url
.split("/")
.nth(4)
.or_else(|| Some(&url))
.unwrap_or_default()
.unwrap_or("vidara")
.to_string(),
)
})
.collect::<Vec<VideoFormat>>();
.ext("m3u8".to_string())
.format_id("hls".to_string())
.video_ext("m3u8".to_string()),
);
}
let mut video_item = VideoItem::new(
id.clone(),
title,