Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the issue of too little or even no live danmaku #218

Merged
merged 4 commits into from
Nov 1, 2023

Conversation

lanytcc
Copy link
Contributor

@lanytcc lanytcc commented Nov 1, 2023

修复直播弹幕过少甚至没有的情况

b站似乎收紧了直播弹幕加入请求的验证,需要匹配当前用户的uid和buvid。我在bilibili::HTTP::COOKIES中获取到了buvid,uid怎么获取,我没看到明显的接口

@xfangfang
Copy link
Owner

xfangfang commented Nov 1, 2023

感谢持续维护。

uid 应该就是 cookie中的 DedeUserID 吧

现在cookie中一共有:"DedeUserID", "DedeUserID__ckMd5", "SESSDATA", "bili_jct", "sid“ 这几个值,不知道哪个是 buvid呢?

只把两个常用的做了接口

#include "utils/config_helper.hpp"

// DedeUserID
ProgramConfig::instance().getUserID();

// bili_jct
ProgramConfig::instance().getCSRF();

try {
HTTP::COOKIES = {false};
nlohmann::json res = nlohmann::json::parse(r.text);
auto data = res.at("data").get<QrLoginInfoResultV2>();
if (data.status) {
std::map<std::string, std::string> cookies;
cookies["buvid3"] = buvid3;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我将buvid添加进了cookie中,在config_helper中也添加了相应接口

@lanytcc
Copy link
Contributor Author

lanytcc commented Nov 1, 2023

此pr如果你看过没问题可以合并了,我发现了其他问题:#219

@xfangfang xfangfang merged commit 69e2a31 into xfangfang:dev Nov 1, 2023
14 checks passed
@xfangfang
Copy link
Owner

感谢,我在我这边也测试看看

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants