javtiful id fix

This commit is contained in:
Simon
2026-05-02 20:19:12 +00:00
committed by ForgeCode
parent 1df76af8f2
commit 275c89efef
3 changed files with 9 additions and 4 deletions

View File

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