Skip to content

Commit

Permalink
Fix huya dm. #159
Browse files Browse the repository at this point in the history
  • Loading branch information
xjbeta committed Jul 6, 2022
1 parent d11aa03 commit 8e06055
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion IINA+/Utils/Danmaku/Danmaku.swift
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ class Danmaku: NSObject {
}
case .huya:
AF.request(url.absoluteString).responseString().done {
let roomData = $0.string.subString(from: "var TT_ROOM_DATA = ", to: ";var").data(using: .utf8) ?? Data()
let js = $0.string.subString(from: "var TT_ROOM_DATA = ", to: "};")
let roomData = (js + "}").data(using: .utf8) ?? Data()
let roomInfo: JSONObject = try JSONParser.JSONObjectWithData(roomData)

self.huyaAnchorUid = try roomInfo.value(for: "id")
Expand Down

0 comments on commit 8e06055

Please sign in to comment.