SocialSisterYi / bilibili-API-collect

哔哩哔哩-API收集整理【不断更新中....】
https://socialsisteryi.github.io/bilibili-API-collect/
Other
15.09k stars 1.71k forks source link

app refresh_token 的用法 #205

Open duzhaokun123 opened 3 years ago

duzhaokun123 commented 3 years ago

参考 https://github.com/duzhaokun123/BilibiliHD2/blob/ff5b99d5940097e3559f3272821b0e4fe1e8615a/bilibili-api/src/main/kotlin/com/hiczp/bilibili/api/passport/PassportAPI.kt#L79-L85 其中cookieMap要传入登录时设置的所有cookie 返回与app登录相同但有效期似乎是三个月

SocialSisterYi commented 3 years ago

感谢提供

mwxmmy commented 1 year ago

//tv token可正常刷新 接口地址为:https://passport.bilibili.com/api/v2/oauth2/refresh_token String url = "https://passport.bilibili.com/api/v2/oauth2/refresh_token"; Map<String, String> params = new TreeMap<>(); params.put("appkey", "4409e2ce8ffd12b8"); params.put("access_token", user.getAccessToken()); params.put("refresh_token", user.getRefreshToken()); params.put("ts", String.valueOf(System.currentTimeMillis())); Map<String, String> headers = new HashMap<>(); headers.put("cookie", user.getCookies()); params.put("sign", "" + sign(params, "59b43e04ad6965f34319062b478f83dd")); return HttpClientUtil.post(url, headers, params, true);