From c7a970454a3eb5ff70cc13a98968185a6ec8c94a Mon Sep 17 00:00:00 2001 From: skbeh <60107333+skbeh@users.noreply.github.com> Date: Sun, 13 Jul 2025 18:09:22 +0000 Subject: [PATCH] feat: support 1080p for anon downloading This change enables anonymous users to download videos in 1080p resolution. By adding the try_look=1 parameter to the /x/player/playurl API call for unauthenticated requests, we can access higher-quality video streams that are otherwise unavailable to users who are not logged in. --- bilix/sites/bilibili/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bilix/sites/bilibili/api.py b/bilix/sites/bilibili/api.py index 3c02f01e..4b476609 100644 --- a/bilix/sites/bilibili/api.py +++ b/bilix/sites/bilibili/api.py @@ -488,6 +488,8 @@ async def _attach_dash_and_durl_from_api(client: httpx.AsyncClient, video_info: 'fnval': 4048, # 如 dash 资源可用,请求 dash 格式的全部可用流 'fourk': 1, # 请求 4k 资源 'fnver': 0, 'platform': 'pc', 'otype': 'json'} + if not client.cookies.get("SESSDATA"): + params["try_look"] = "1" dash_response = await req_retry(client, 'https://api.bilibili.com/x/player/playurl', params=params, follow_redirects=True) dash_json = json.loads(dash_response.text)