From 70b3e4cfc0ee0085cd4b0b1dfffb09ddba98c997 Mon Sep 17 00:00:00 2001 From: pchpub <73123406+pchpub@users.noreply.github.com> Date: Mon, 29 Aug 2022 13:31:40 +0800 Subject: [PATCH] force qn=112 --- src/main.rs | 6 +++--- src/mods/get_bili_res.rs | 45 ++++++++++++++-------------------------- 2 files changed, 18 insertions(+), 33 deletions(-) diff --git a/src/main.rs b/src/main.rs index e9f68de3..43eef7a7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -195,13 +195,13 @@ fn main() -> std::io::Result<()> { .unwrap(); let web_background = async move { //a thread try to update cache - println!("[Debug] spawn web_background"); + //println!("[Debug] spawn web_background"); loop { let receive_data = match r.recv().await { Ok(it) => it, _ => break, }; - println!("[Debug] r:{}",r.len()); + //println!("[Debug] r:{}",r.len()); match receive_data.data_type { 1 => { match get_playurl_background( @@ -221,7 +221,7 @@ fn main() -> std::io::Result<()> { _ => {} } } - println!("[Debug] exit web_background"); + //println!("[Debug] exit web_background"); }; let rate_limit_conf = GovernorConfigBuilder::default() diff --git a/src/mods/get_bili_res.rs b/src/mods/get_bili_res.rs index 978a0aa2..3efb4bc4 100644 --- a/src/mods/get_bili_res.rs +++ b/src/mods/get_bili_res.rs @@ -217,7 +217,7 @@ pub async fn get_playurl(req: &HttpRequest, is_app: bool, is_th: bool) -> HttpRe //地区 cn 1 // hk 2 // tw 3 - // th 4 + // th 4 // default 2 //类型 app playurl 01 // app search 02 @@ -259,37 +259,22 @@ pub async fn get_playurl(req: &HttpRequest, is_app: bool, is_th: bool) -> HttpRe }; let response_body: String; if is_expire || need_flash { - //println!("is_expire"); let ts_string = ts.to_string(); let mut query_vec: Vec<(&str, &str)>; if is_tv { - if is_vip == 1 { - query_vec = vec![ - ("access_key", &access_key[..]), - ("appkey", appkey), - ("build", query.get("build").unwrap_or("6800300")), - ("device", query.get("device").unwrap_or("android")), - ("fnval", "130"), - ("fnver", "0"), - ("fourk", "1"), - ("platform", "android"), - ("qn", "112"), - ("ts", &ts_string), - ]; - } else { - query_vec = vec![ - ("access_key", &access_key[..]), - ("appkey", appkey), - ("build", query.get("build").unwrap_or("6800300")), - ("device", query.get("device").unwrap_or("android")), - ("fnval", "130"), - ("fnver", "0"), - ("fourk", "1"), - ("platform", "android"), - ("qn", "112"),//Debug 原来是64,测试下会返回什么内容 - ("ts", &ts_string), - ]; - } + query_vec = vec![ + ("access_key", &access_key[..]), + ("appkey", appkey), + ("build", query.get("build").unwrap_or("6800300")), + ("device", query.get("device").unwrap_or("android")), + ("fnval", "130"), + ("fnver", "0"), + ("fourk", "1"), + ("platform", "android"), + //("qn", query.get("qn").unwrap_or("112")), //720P 64 1080P高码率 112 + ("qn", "112"),//测试了下,没会员会回落到下一档,所以没必要区分 DLNA投屏就最高一档好了,支持其他档没必要,还增加服务器负担 + ("ts", &ts_string), + ]; } else { query_vec = vec![ ("access_key", &access_key[..]), @@ -460,7 +445,7 @@ pub async fn get_playurl(req: &HttpRequest, is_app: bool, is_th: bool) -> HttpRe area_num, }; spawn(move || { - println!("[Debug] bilisender_cl.len:{}", bilisender_cl.len()); + //println!("[Debug] bilisender_cl.len:{}", bilisender_cl.len()); match bilisender_cl.try_send(senddata) { Ok(_) => (), Err(TrySendError::Full(_)) => {