feat: 修改referer和origin为移动端,目前测试是可以减少风控。未经详细测试

This commit is contained in:
姚彪
2023-12-12 00:07:28 +08:00
parent 56f28bff81
commit d550f4d50a
2 changed files with 4 additions and 2 deletions

View File

@@ -205,7 +205,7 @@ public static class VideoStream
/// <returns></returns>
private static PlayUrl GetPlayUrl(string url)
{
string referer = "https://www.bilibili.com";
string referer = "https://m.bilibili.com";
string response = WebClient.RequestWeb(url, referer);
try

View File

@@ -66,7 +66,7 @@ internal static class WebClient
// 构造cookie
if (!url.Contains("getLogin"))
{
request.Headers["origin"] = "https://www.bilibili.com";
request.Headers["origin"] = "https://m.bilibili.com";
CookieContainer cookies = LoginHelper.GetLoginInfoCookies();
if (cookies != null)
@@ -75,6 +75,8 @@ internal static class WebClient
}
}
request.Proxy = new WebProxy("http://localhost:8080");
string html = string.Empty;
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{