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]

View File

@@ -172,7 +172,7 @@ impl crate::proxies::Proxy for PimpbunnyProxy {
let mut requester = requester.get_ref().clone();
Self::warm_root_session(&mut requester).await;
let headers = Self::headers_with_cookies(&requester, &detail_url, Self::root_referer());
let headers = Self::headers_with_cookies(&requester, &detail_url, &detail_url);
let text = match requester
.get_with_headers(&detail_url, headers, Some(Version::HTTP_2))
.await