diff --git a/IINA+.xcodeproj/project.pbxproj b/IINA+.xcodeproj/project.pbxproj index 976c44d0..e655e6d4 100644 --- a/IINA+.xcodeproj/project.pbxproj +++ b/IINA+.xcodeproj/project.pbxproj @@ -1041,7 +1041,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.7.29; + MARKETING_VERSION = 0.7.30; PRODUCT_BUNDLE_IDENTIFIER = "com.xjbeta.iina-plus"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1068,7 +1068,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.7.29; + MARKETING_VERSION = 0.7.30; PRODUCT_BUNDLE_IDENTIFIER = "com.xjbeta.iina-plus"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/IINA+/Utils/VideoDecoder/Huya.swift b/IINA+/Utils/VideoDecoder/Huya.swift index 26f04dce..a33d22a0 100644 --- a/IINA+/Utils/VideoDecoder/Huya.swift +++ b/IINA+/Utils/VideoDecoder/Huya.swift @@ -141,7 +141,17 @@ class Huya: NSObject, SupportSiteProtocol { } let rid = ucs[2] - return pSession.request("https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid=\(rid)").responseData().map { + if let rid = Int(rid) { + return getHuyaInfoMP(rid) + } else { + return getHuyaInfo(url).then { + self.getHuyaInfoMP($0.rid) + } + } + } + + func getHuyaInfoMP(_ rid: Int) -> Promise { + pSession.request("https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid=\(rid)").responseData().map { let jsonObj: JSONObject = try JSONParser.JSONObjectWithData($0.data) return try HuyaInfoMP(object: jsonObj) }