fixes etc
This commit is contained in:
@@ -13,7 +13,38 @@ impl SpankbangProxy {
|
||||
}
|
||||
|
||||
fn request_headers() -> Vec<(String, String)> {
|
||||
vec![("Referer".to_string(), "https://spankbang.com/".to_string())]
|
||||
vec![
|
||||
(
|
||||
"accept".to_string(),
|
||||
"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8"
|
||||
.to_string(),
|
||||
),
|
||||
("accept-language".to_string(), "en-US,en;q=0.6".to_string()),
|
||||
("cache-control".to_string(), "no-cache".to_string()),
|
||||
("pragma".to_string(), "no-cache".to_string()),
|
||||
("priority".to_string(), "u=0, i".to_string()),
|
||||
(
|
||||
"sec-ch-ua".to_string(),
|
||||
r#""Chromium";v="146", "Not-A.Brand";v="24", "Brave";v="146""#.to_string(),
|
||||
),
|
||||
("sec-ch-ua-mobile".to_string(), "?0".to_string()),
|
||||
("sec-ch-ua-platform".to_string(), "\"Linux\"".to_string()),
|
||||
("sec-fetch-dest".to_string(), "document".to_string()),
|
||||
("sec-fetch-mode".to_string(), "navigate".to_string()),
|
||||
("sec-fetch-site".to_string(), "none".to_string()),
|
||||
("sec-fetch-user".to_string(), "?1".to_string()),
|
||||
("sec-gpc".to_string(), "1".to_string()),
|
||||
(
|
||||
"upgrade-insecure-requests".to_string(),
|
||||
"1".to_string(),
|
||||
),
|
||||
(
|
||||
"user-agent".to_string(),
|
||||
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36"
|
||||
.to_string(),
|
||||
),
|
||||
("Referer".to_string(), "https://spankbang.com/".to_string()),
|
||||
]
|
||||
}
|
||||
|
||||
fn extract_stream_data(text: &str) -> Option<&str> {
|
||||
@@ -76,7 +107,38 @@ mod tests {
|
||||
fn prefers_m3u8_when_present() {
|
||||
assert_eq!(
|
||||
SpankbangProxy::request_headers(),
|
||||
vec![("Referer".to_string(), "https://spankbang.com/".to_string())]
|
||||
vec![
|
||||
(
|
||||
"accept".to_string(),
|
||||
"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8"
|
||||
.to_string(),
|
||||
),
|
||||
("accept-language".to_string(), "en-US,en;q=0.6".to_string()),
|
||||
("cache-control".to_string(), "no-cache".to_string()),
|
||||
("pragma".to_string(), "no-cache".to_string()),
|
||||
("priority".to_string(), "u=0, i".to_string()),
|
||||
(
|
||||
"sec-ch-ua".to_string(),
|
||||
r#""Chromium";v="146", "Not-A.Brand";v="24", "Brave";v="146""#.to_string(),
|
||||
),
|
||||
("sec-ch-ua-mobile".to_string(), "?0".to_string()),
|
||||
("sec-ch-ua-platform".to_string(), "\"Linux\"".to_string()),
|
||||
("sec-fetch-dest".to_string(), "document".to_string()),
|
||||
("sec-fetch-mode".to_string(), "navigate".to_string()),
|
||||
("sec-fetch-site".to_string(), "none".to_string()),
|
||||
("sec-fetch-user".to_string(), "?1".to_string()),
|
||||
("sec-gpc".to_string(), "1".to_string()),
|
||||
(
|
||||
"upgrade-insecure-requests".to_string(),
|
||||
"1".to_string(),
|
||||
),
|
||||
(
|
||||
"user-agent".to_string(),
|
||||
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36"
|
||||
.to_string(),
|
||||
),
|
||||
("Referer".to_string(), "https://spankbang.com/".to_string()),
|
||||
]
|
||||
);
|
||||
|
||||
let data = r#"
|
||||
|
||||
Reference in New Issue
Block a user