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