removed proxy from pornhub
This commit is contained in:
@@ -54,10 +54,14 @@ impl PornhubProvider {
|
||||
let proxy = Proxy::all("http://192.168.0.103:8081").unwrap();
|
||||
let client = Client::builder().cert_verification(false).emulation(Emulation::Firefox136).build()?;
|
||||
|
||||
let mut response = client.get(url.clone()).proxy(proxy.clone()).send().await?;
|
||||
let mut response = client.get(url.clone())
|
||||
// .proxy(proxy.clone())
|
||||
.send().await?;
|
||||
if response.status().is_redirection(){
|
||||
|
||||
response = client.get(self.url.clone() + response.headers()["Location"].to_str().unwrap()).proxy(proxy).send().await?;
|
||||
response = client.get(self.url.clone() + response.headers()["Location"].to_str().unwrap())
|
||||
// .proxy(proxy)
|
||||
.send().await?;
|
||||
}
|
||||
if response.status().is_success() {
|
||||
let text = response.text().await?;
|
||||
@@ -149,11 +153,15 @@ impl PornhubProvider {
|
||||
let proxy = Proxy::all("http://192.168.0.103:8081").unwrap();
|
||||
let client = Client::builder().cert_verification(false).emulation(Emulation::Firefox136).build()?;
|
||||
|
||||
let mut response = client.get(url.clone()).proxy(proxy.clone()).send().await?;
|
||||
let mut response = client.get(url.clone())
|
||||
// .proxy(proxy.clone())
|
||||
.send().await?;
|
||||
|
||||
if response.status().is_redirection(){
|
||||
|
||||
response = client.get(self.url.clone() + response.headers()["Location"].to_str().unwrap()).proxy(proxy).send().await?;
|
||||
response = client.get(self.url.clone() + response.headers()["Location"].to_str().unwrap())
|
||||
// .proxy(proxy)
|
||||
.send().await?;
|
||||
}
|
||||
|
||||
if response.status().is_success() {
|
||||
@@ -320,6 +328,10 @@ impl Provider for PornhubProvider {
|
||||
let _ = per_page;
|
||||
let _ = featured; // Ignored in this implementation
|
||||
let _ = pool; // Ignored in this implementation
|
||||
let mut sort = sort.to_lowercase();
|
||||
if sort == "date"{
|
||||
sort = "mr".to_string();
|
||||
}
|
||||
let videos: std::result::Result<Vec<VideoItem>, Error> = match query {
|
||||
Some(q) => {
|
||||
self.query(cache, page.parse::<u8>().unwrap_or(1), &q, &sort)
|
||||
|
||||
Reference in New Issue
Block a user