header fix
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user