Skip to content

Commit

Permalink
add referer
Browse files Browse the repository at this point in the history
  • Loading branch information
My-Responsitories committed Jul 27, 2023
1 parent d62e44a commit 69bfd84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions BBDown.Core/Util/HTTPUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public static async Task<string> GetWebSourceAsync(string url)
webRequest.Headers.TryAddWithoutValidation("User-Agent", GetRandomUserAgent());
webRequest.Headers.TryAddWithoutValidation("Accept-Encoding", "gzip, deflate");
webRequest.Headers.TryAddWithoutValidation("Cookie", (url.Contains("/ep") || url.Contains("/ss")) ? Config.COOKIE + ";CURRENT_FNVAL=4048;" : Config.COOKIE);
if (url.Contains("api.bilibili.com/pgc/player/web/playurl") || url.Contains("api.bilibili.com/pugv/player/web/playurl"))
webRequest.Headers.TryAddWithoutValidation("Referer", "https://www.bilibili.com");
if (url.Contains("api.bilibili.com"))
webRequest.Headers.TryAddWithoutValidation("Referer", "https://www.bilibili.com/");
webRequest.Headers.CacheControl = CacheControlHeaderValue.Parse("no-cache");
webRequest.Headers.Connection.Clear();

Expand Down

0 comments on commit 69bfd84

Please sign in to comment.