pmvhaven fix
This commit is contained in:
@@ -26,6 +26,7 @@ struct PmvhavenRequest {
|
||||
other: bool, // false,
|
||||
explicitContent: Option<bool>, //null,
|
||||
sameSexContent: Option<bool>, //null,
|
||||
transContent: Option<String>, //null
|
||||
seizureWarning: Option<bool>, //null,
|
||||
tags: Vec<String>, //[],
|
||||
music: Vec<String>, //[],
|
||||
@@ -37,7 +38,6 @@ struct PmvhavenRequest {
|
||||
aspectRatio: String, //"Aspect Ratio",
|
||||
activeView: String, //"Newest",
|
||||
index: u32, //2,
|
||||
hideUntagged: bool, //true,
|
||||
showSubscriptionsOnly: bool, //false,
|
||||
query: String, //"no",
|
||||
profile: Option<String>, //null
|
||||
@@ -55,6 +55,7 @@ impl PmvhavenRequest {
|
||||
other: false,
|
||||
explicitContent: None,
|
||||
sameSexContent: None,
|
||||
transContent: None,
|
||||
seizureWarning: None,
|
||||
tags: vec![],
|
||||
music: vec![],
|
||||
@@ -66,7 +67,6 @@ impl PmvhavenRequest {
|
||||
aspectRatio: "Aspect Ratio".to_string(),
|
||||
activeView: "Newest".to_string(),
|
||||
index: page,
|
||||
hideUntagged: true,
|
||||
showSubscriptionsOnly: false,
|
||||
query: "no".to_string(),
|
||||
profile: None,
|
||||
@@ -210,32 +210,8 @@ impl PmvhavenVideo {
|
||||
}
|
||||
}
|
||||
|
||||
// Define a percent-encoding set that encodes all non-ASCII characters
|
||||
// const EMOJI_ENCODE_SET: &AsciiSet = &CONTROLS
|
||||
// .add(b' ')
|
||||
// .add(b'"')
|
||||
// .add(b'#')
|
||||
// .add(b'%')
|
||||
// .add(b'<')
|
||||
// .add(b'>')
|
||||
// .add(b'?')
|
||||
// .add(b'[')
|
||||
// .add(b'\\')
|
||||
// .add(b']')
|
||||
// .add(b'^')
|
||||
// .add(b'`')
|
||||
// .add(b'{')
|
||||
// .add(b'|')
|
||||
// .add(b'}');
|
||||
//
|
||||
// Helper function to percent-encode emojis and other non-ASCII chars
|
||||
// fn percent_encode_emojis(s: &str) -> String {
|
||||
// utf8_percent_encode(s, EMOJI_ENCODE_SET).to_string()
|
||||
// }
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
struct PmvhavenResponse {
|
||||
_httpStatusCode: Option<u32>,
|
||||
data: Vec<PmvhavenVideo>,
|
||||
_count: Option<u32>,
|
||||
}
|
||||
@@ -311,7 +287,7 @@ impl PmvhavenProvider {
|
||||
};
|
||||
|
||||
let mut requester = options.requester.clone().unwrap();
|
||||
let response = requester.post(&url, &request).await.unwrap();
|
||||
let response = requester.post(&url, &request, vec![("Content-Type".to_string(),"text/plain;charset=UTF-8".to_string())]).await.unwrap();
|
||||
let videos = match response.json::<PmvhavenResponse>().await {
|
||||
Ok(resp) => resp,
|
||||
Err(e) => {
|
||||
@@ -355,7 +331,7 @@ impl PmvhavenProvider {
|
||||
};
|
||||
|
||||
let mut requester = options.requester.clone().unwrap();
|
||||
let response = requester.post(&url, &request).await.unwrap();
|
||||
let response = requester.post(&url, &request, vec![("Content-Type".to_string(),"text/plain;charset=UTF-8".to_string())]).await.unwrap();
|
||||
let videos = match response.json::<PmvhavenResponse>().await {
|
||||
Ok(resp) => resp,
|
||||
Err(e) => {
|
||||
|
||||
Reference in New Issue
Block a user