Skip to content

Commit

Permalink
fix: add useragent on danmu provider
Browse files Browse the repository at this point in the history
  • Loading branch information
yichengchen committed Sep 27, 2023
1 parent 5dcdd66 commit 2691aa7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion BilibiliLive/Module/Live/LiveDanMuProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class LiveDanMuProvider {
}

func start() {
let request = URLRequest(url: URL(string: "ws://broadcastlv.chat.bilibili.com:2244/sub")!)
var request = URLRequest(url: URL(string: "ws://broadcastlv.chat.bilibili.com:2244/sub")!)
request.allHTTPHeaderFields = ["User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36", "Referer": "https://live.bilibili.com"]
websocket = WebSocket(request: request)
websocket?.delegate = self
websocket?.connect()
Expand Down

0 comments on commit 2691aa7

Please sign in to comment.