Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/bump_dep_version' into bump_dep_…
Browse files Browse the repository at this point in the history
…version
  • Loading branch information
KanaMiao committed Sep 18, 2023
2 parents f608707 + 03f1ba6 commit da89317
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 48 deletions.
40 changes: 20 additions & 20 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@ version = "0.3.3"
edition = "2021"

[dependencies]
chrono = "0.4.23"
actix-web = {version = "4.2.1", features = ["rustls","compress-brotli","compress-gzip","compress-zstd"]}
actix-files = "0.6.2"
qstring = "0.7.2"
rust-crypto = "0.2.36"
serde_json = "1.0.89"
serde_yaml = "0.9.14"
serde = {version = "1.0.147",features = ["derive"]}
actix-governor = "0.4.1"
actix-web = { version = "4.3.1", features = ["rustls","compress-brotli","compress-gzip","compress-zstd"] }
async-channel = "1.8.0"
base64 = "0.21.2"
chrono = "0.4.26"
ctrlc = "3.4.0"
deadpool = "0.9.5"
deadpool-redis = "0.11.0"
async-channel = "1.7.1"
futures = "0.3.25"
tokio = { version = "1.22.0", features = ["full"] }
pcre2 = "0.2.3"
ctrlc = "3.2.3"
rand = "0.8.5"
actix-governor = "0.4.0-beta.3"
base64 = "0.21.0"
urlencoding = "2.1.2"
deadpool-redis = "0.12.0"
env_logger = "0.10.0"
futures = "0.3.28"
lazy_static = "1.4.0"
log = "0.4"
env_logger = "0.10.0"
reqwest = {version = "0.11.14",features = ["socks","brotli","gzip","deflate","rustls-tls"]}
pcre2 = "0.2.4"
qstring = "0.7.2"
rand = "0.8.5"
reqwest = { version = "0.11.18", features = ["socks","brotli","gzip","deflate","rustls-tls"] }
rust-crypto = "0.2.36"
rustls = "0.20.8"
rustls-pemfile = "1.0.2"
rustls-pemfile = "1.0.3"
serde = { version = "1.0.164", features = ["derive"] }
serde_json = "1.0.99"
serde_yaml = "0.9.22"
tokio = { version = "1.29.1", features = ["full"] }
urlencoding = "2.1.2"

[profile.fast]
inherits = "release"
Expand Down
75 changes: 47 additions & 28 deletions src/mods/upstream_res.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1316,9 +1316,9 @@ pub async fn get_upstream_bili_search(

query_vec.sort_by_key(|v| v.0.clone());

let signed_url = if !params.is_app {
let signed_url = if !params.is_app {
format!("{}?{}", api, raw_query)
}else{
} else {
build_signed_url!(api, query_vec, params.appsec).0
};

Expand Down Expand Up @@ -1594,32 +1594,51 @@ pub async fn get_upstream_bili_season(
}
}
}
let mut index_of_replace_json = 0;
let len_of_replace_json =
sub_replace_json["data"].as_array().unwrap().len();
while index_of_replace_json < len_of_replace_json {
let ep: usize = sub_replace_json["data"][index_of_replace_json]["ep"]
.as_u64()
.unwrap() as usize;
let key = sub_replace_json["data"][index_of_replace_json]["key"]
.as_str()
.unwrap();
let lang = sub_replace_json["data"][index_of_replace_json]["lang"]
.as_str()
.unwrap();
let url = sub_replace_json["data"][index_of_replace_json]["url"]
.as_str()
.unwrap();
if is_result {
let element = format!("{{\"id\":{index_of_replace_json},\"key\":\"{key}\",\"title\":\"[非官方] {lang} {}\",\"url\":\"https://{url}\"}}",config.th_app_season_sub_name);
body_data_json["result"]["modules"][0]["data"]["episodes"][ep]
["subtitles"]
.as_array_mut()
.unwrap()
.insert(0, serde_json::from_str(&element).unwrap());
}
index_of_replace_json += 1;
}
sub_replace_json["data"]
.as_array()
.unwrap()
.iter()
.enumerate()
.for_each(|(id, item)| {
let ep = item["ep"].as_u64().unwrap() as usize;
let key = item["key"].as_str().unwrap();
let lang = item["lang"].as_str().unwrap();
let url = item["url"].as_str().unwrap();
if is_result {
let element = format!("{{\"id\":{id},\"key\":\"{key}\",\"title\":\"[非官方] {lang} {}\",\"url\":\"https://{url}\"}}",config.th_app_season_sub_name);
body_data_json["result"]["modules"][0]["data"]["episodes"][ep]
["subtitles"]
.as_array_mut()
.unwrap()
.insert(0, serde_json::from_str(&element).unwrap());
}
});
// let mut index_of_replace_json = 0;
// let len_of_replace_json =
// sub_replace_json["data"].as_array().unwrap().len();
// while index_of_replace_json < len_of_replace_json {
// let ep: usize = sub_replace_json["data"][index_of_replace_json]["ep"]
// .as_u64()
// .unwrap() as usize;
// let key = sub_replace_json["data"][index_of_replace_json]["key"]
// .as_str()
// .unwrap();
// let lang = sub_replace_json["data"][index_of_replace_json]["lang"]
// .as_str()
// .unwrap();
// let url = sub_replace_json["data"][index_of_replace_json]["url"]
// .as_str()
// .unwrap();
// if is_result {
// let element = format!("{{\"id\":{index_of_replace_json},\"key\":\"{key}\",\"title\":\"[非官方] {lang} {}\",\"url\":\"https://{url}\"}}",config.th_app_season_sub_name);
// body_data_json["result"]["modules"][0]["data"]["episodes"][ep]
// ["subtitles"]
// .as_array_mut()
// .unwrap()
// .insert(0, serde_json::from_str(&element).unwrap());
// }
// index_of_replace_json += 1;
// }
}

return serde_json::to_string(&body_data_json).unwrap();
Expand Down

0 comments on commit da89317

Please sign in to comment.