From 79b4d9430fca3ebb86c57ee506989f620ea68a21 Mon Sep 17 00:00:00 2001 From: THMonster <5125031+THMonster@users.noreply.github.com> Date: Sat, 25 Jan 2025 12:14:20 +0800 Subject: [PATCH] support dolby vision for bilibili fix cookies from chrome --- Cargo.toml | 2 +- src/streamfinder/bilibili.rs | 2 +- src/utils/cookies.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 887d715..2e8471a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dmlive" -version = "5.5.5" +version = "5.5.7" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/streamfinder/bilibili.rs b/src/streamfinder/bilibili.rs index 37fc7e8..4cfa2e2 100644 --- a/src/streamfinder/bilibili.rs +++ b/src/streamfinder/bilibili.rs @@ -310,7 +310,7 @@ impl Bilibili { ("bvid", bvid), ("cid", cid), ("qn", String::from("0")), - ("fnval", String::from("80")), + ("fnval", String::from("848")), ("fnver", String::from("0")), ("fourk", String::from("1")), ]; diff --git a/src/utils/cookies.rs b/src/utils/cookies.rs index c146660..0a96edf 100644 --- a/src/utils/cookies.rs +++ b/src/utils/cookies.rs @@ -71,7 +71,7 @@ fn decrypt_chrome_cookie(data: &mut [u8], key: &[u8; 16]) -> anyhow::Result(&mut buf) .map_err(|_| anyhow::anyhow!("decryption failed"))?; - return Ok(String::from_utf8_lossy(pt).into()); + return Ok(String::from_utf8_lossy(pt.get(32..).unwrap_or(b"")).into()); } else { return Err(anyhow::anyhow!("a v10 cookie")); }