header fix

This commit is contained in:
Simon
2026-04-06 06:51:43 +00:00
parent 70355dd969
commit a7e38c97a6
2 changed files with 12 additions and 2 deletions

View File

@@ -799,7 +799,8 @@ impl PimpbunnyProvider {
let formats = vec![
VideoFormat::new(proxy_url.clone(), "auto".into(), "video/mp4".into())
.format_id("auto".into())
.format_note("proxied".into()),
.format_note("proxied".into())
.http_header("Referer".to_string(), video_url.clone()),
];
Ok(
@@ -969,6 +970,15 @@ mod tests {
assert_eq!(items[0].duration, 754);
assert_eq!(items[0].views, Some(1200));
assert_eq!(items[0].formats.as_ref().map(|f| f.len()), Some(1));
assert_eq!(
items[0].formats.as_ref().and_then(|formats| formats.first()).map(
|format| format.http_headers_pairs().contains(&(
"Referer".to_string(),
"https://pimpbunny.com/videos/example-video/".to_string(),
))
),
Some(true)
);
}
#[test]