Compare commits

..

2 Commits

Author SHA1 Message Date
Simon
275c89efef javtiful id fix 2026-05-02 20:19:12 +00:00
Simon
1df76af8f2 javtiful sorting fix 2026-05-02 14:45:06 +00:00
3 changed files with 10 additions and 5 deletions

View File

@@ -654,6 +654,12 @@ async fn videos_post(
video_items.len() video_items.len()
); );
for video in video_items.iter_mut() {
video.id = format!("{}:{}", channel, video.id);
println!("Video ID set to: {}", video.id);
}
// There is a bug in Hottub38 that makes the client error for a 403-url even though formats work fine // There is a bug in Hottub38 that makes the client error for a 403-url even though formats work fine
if clientversion == ClientVersion::new(38, 0, "Hot%20Tub".to_string()) { if clientversion == ClientVersion::new(38, 0, "Hot%20Tub".to_string()) {
// filter out videos without preview for old clients // filter out videos without preview for old clients

View File

@@ -120,7 +120,8 @@ impl JavtifulProvider {
"popular" => "sort=popular&", "popular" => "sort=popular&",
_ => "", _ => "",
}; };
let video_url = format!("{}/videos{}?page={}", self.url, sort_string, page); let video_url = format!("{}/videos?{}page={}", self.url, sort_string, page);
println!("Fetching URL: {}", video_url);
let old_items = match cache.get(&video_url) { let old_items = match cache.get(&video_url) {
Some((time, items)) => { Some((time, items)) => {
if time.elapsed().unwrap_or_default().as_secs() < 60 * 5 { if time.elapsed().unwrap_or_default().as_secs() < 60 * 5 {
@@ -343,10 +344,9 @@ impl JavtifulProvider {
.unwrap_or(title) .unwrap_or(title)
.titlecase(); .titlecase();
let id = video_url let id = video_url
.split('/') .split("/video/")
.filter(|s| !s.is_empty()) .filter(|s| !s.is_empty())
.nth(2) .nth(1)
.and_then(|s| s.split('.').next())
.ok_or_else(|| ErrorKind::Parse(format!("video id\n\n{seg}")))? .ok_or_else(|| ErrorKind::Parse(format!("video id\n\n{seg}")))?
.to_string(); .to_string();
let thumb_block = seg.split("<img ").nth(1); let thumb_block = seg.split("<img ").nth(1);

View File

@@ -653,7 +653,6 @@ pub fn strip_url_scheme(url: &str) -> String {
#[allow(dead_code)] #[allow(dead_code)]
pub fn build_proxy_url(options: &ServerOptions, proxy: &str, target: &str) -> String { pub fn build_proxy_url(options: &ServerOptions, proxy: &str, target: &str) -> String {
println!("Building proxy URL with options={:?}, proxy={}, target={}", options, proxy, target);
let target = target.trim_start_matches('/'); let target = target.trim_start_matches('/');
let base = options let base = options
.public_url_base .public_url_base