Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
xjbeta committed Jan 24, 2024
2 parents 711914d + 83129ff commit 6a6f88b
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@ jobs:
cd AppUpdaterAppcasts
# git checkout -b ci-test
git add -A
git commit -m "$(basename ../archive/IINA+.xcarchive/Products/Applications/*.zip zip)"
git commit -m "$(basename ../archive/IINA+.xcarchive/Products/Applications/*.dmg dmg)"
git push https://${{ secrets.PAT }}@github.com/xjbeta/AppUpdaterAppcasts.git
10 changes: 5 additions & 5 deletions IINA+.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 0940;
LastUpgradeCheck = 1500;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = xjbeta;
TargetAttributes = {
01AEC8A620EDFD01001406E8 = {
Expand Down Expand Up @@ -944,7 +944,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
Expand Down Expand Up @@ -1003,7 +1003,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
Expand All @@ -1029,7 +1029,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.7.16;
MARKETING_VERSION = 0.7.17;
PRODUCT_BUNDLE_IDENTIFIER = "com.xjbeta.iina-plus";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -1056,7 +1056,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.7.16;
MARKETING_VERSION = 0.7.17;
PRODUCT_BUNDLE_IDENTIFIER = "com.xjbeta.iina-plus";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/krzyzanowskim/CryptoSwift",
"state" : {
"revision" : "db51c407d3be4a051484a141bf0bff36c43d3b1e",
"version" : "1.8.0"
"revision" : "7892a123f7e8d0fe62f9f03728b17bbd4f94df5c",
"version" : "1.8.1"
}
},
{
Expand Down Expand Up @@ -59,8 +59,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/SDWebImage/SDWebImage",
"state" : {
"revision" : "1b9a2e902cbde5fdf362faa0f4fd76ea74d74305",
"version" : "5.18.5"
"revision" : "59730af512c06fb569c119d737df4c1c499e001d",
"version" : "5.18.10"
}
},
{
Expand All @@ -77,8 +77,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/sparkle-project/Sparkle",
"state" : {
"revision" : "1f07f4096e52f19b5e7abaa697b7fc592b7ff57c",
"version" : "2.5.1"
"revision" : "47d3d90aee3c52b6f61d04ceae426e607df62347",
"version" : "2.5.2"
}
},
{
Expand Down Expand Up @@ -113,8 +113,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/scinfu/SwiftSoup",
"state" : {
"revision" : "8b6cf29eead8841a1fa7822481cb3af4ddaadba6",
"version" : "2.6.1"
"revision" : "f83c097597094a04124eb6e0d1e894d24129af87",
"version" : "2.7.0"
}
}
],
Expand Down
45 changes: 31 additions & 14 deletions IINA+/Utils/VideoDecoder/DouYin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,15 @@ addXMLRequestCallback(function (xhr) {
}

var state = DYState.none
var timerStarted = false

return Promise { resolver in
dyFinishNitification = NotificationCenter.default.addObserver(forName: .douyinWebcastUpdated, object: nil, queue: .main) { _ in
guard state == .none else { return }
state = .checking

Log("Douyin WebcastUpdated")

if let n = self.dyFinishNitification {
NotificationCenter.default.removeObserver(n)
}
Expand All @@ -273,22 +276,23 @@ addXMLRequestCallback(function (xhr) {
if s.contains("抖音直播") {
self.webViewLoadingObserver?.invalidate()
self.webViewLoadingObserver = nil

DispatchQueue.main.asyncAfter(deadline: .now() + 60) {
guard state == .none else { return }
Log("DouYin Cookies timeout, check cookies.")
NotificationCenter.default.post(name: .douyinWebcastUpdated, object: nil)
}
} else if s.contains("验证") {
Log("Douyin reload init url")
self.deleteCookies().done {
self.webView?.load(.init(url: self.douyinEmptyURL))
}.catch({ _ in })
}
}

guard !timerStarted else { return }
timerStarted = true
DispatchQueue.main.asyncAfter(deadline: .now() + 60) {
guard state == .none else { return }
Log("DouYin Cookies timeout, check cookies.")
NotificationCenter.default.post(name: .douyinWebcastUpdated, object: nil)
}
}


webView?.load(.init(url: douyinEmptyURL))
}
}
Expand Down Expand Up @@ -338,14 +342,19 @@ addXMLRequestCallback(function (xhr) {
self.getEnterContent(self.douyinEmptyURL.absoluteString)
}.done { info in
Log("Douyin test info \(info.title)")
Log("Douyin deinit webview")

self.webView?.stopLoading()
self.webView?.removeFromSuperview()
self.webView = nil
self.deinitWebView()
}
}

func deinitWebView() {
Log("Douyin deinit webview")

self.webView?.stopLoading()
self.webView?.configuration.userContentController.removeScriptMessageHandler(forName: "fetch")
self.webView?.removeFromSuperview()
self.webView = nil
}

func deleteCookies() -> Promise<()> {
getAllWKCookies().then {
when(fulfilled: $0.map(self.deleteWKCookie))
Expand Down Expand Up @@ -391,11 +400,19 @@ extension DouYin: WKScriptMessageHandler {
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
guard let msg = message.body as? String else { return }

if msg.contains("webcast/im/push/v2") {
func post() {
NotificationCenter.default.post(name: .douyinWebcastUpdated, object: nil)
}

if msg.contains("webcast/im/push/v2") {
post()
} else if msg.contains("live.douyin.com/webcast/im/fetch"),
msg.contains("last_rtt=-1") {
NotificationCenter.default.post(name: .douyinWebcastUpdated, object: nil)
post()
} else if msg.contains("live.douyin.com/aweme/v1/web/emoji/list") {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
post()
}
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions IINA+/Views/JSPlayer/JSPlayerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class JSPlayerViewController: NSViewController {
func string() -> String {
switch self {
case .notLiving:
return "Not Living"
return NSLocalizedString("VideoGetError.isNotLiving" , comment: "isNotLiving")
case .openFailed:
return "Open Failed"
case .unknown:
Expand All @@ -153,7 +153,7 @@ class JSPlayerViewController: NSViewController {

switch playerState {
case .loadingWebView, .stuckChecking, .opening:
stateTF.stringValue = "Loading..."
stateTF.stringValue = NSLocalizedString("Loading..." , comment: "Loading...")
stateTF.isHidden = false
case .error(let err):
stateTF.stringValue = err.string()
Expand Down Expand Up @@ -692,6 +692,9 @@ extension JSPlayerViewController: NSWindowDelegate {
videoKey = nil
videoLine = 0

hideOSCTimer?.stop()
hideOSCTimer = nil

danmaku?.stop()
danmaku = nil
deinitWebView()
Expand Down
3 changes: 3 additions & 0 deletions IINA+/Views/JSPlayer/zh-Hans.lproj/JSPlayer.strings
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@

/* Class = "NSBox"; title = "Box"; ObjectID = "V00-Sg-zdq"; */
"V00-Sg-zdq.title" = "";

/* Class = "NSTextFieldCell"; title = "Loading..."; ObjectID = "Fns-6s-teh"; */
"Fns-6s-teh.title" = "加载中...";
13 changes: 8 additions & 5 deletions IINA+/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
/* No comment provided by engineer. */
"mainMenu.view.reloadLiveStatus" = "Reload Live Status";

/* plugin install finish */
"PluginInstaller.tips" = "\nEverything OK ✅\nRestart IINA to take effect";

/* Quit anyway button title */
"Quit anyway" = "Quit anyway";

Expand Down Expand Up @@ -46,6 +49,9 @@
/* Huya */
"SupportSites.Huya" = "Huya";

/* KuaiShou */
"SupportSites.KuaiShou" = "KuaiShou";

/* QQ Live */
"SupportSites.QQLive" = "QQ Live";

Expand All @@ -70,8 +76,5 @@
/* ಠ_ಠ oops, */
"VideoGetError.oops" = "ಠ_ಠ oops, ";

/* KuaiShou */
"SupportSites.KuaiShou" = "KuaiShou";

/* plugin install finish */
"PluginInstaller.tips" = "\nEverything OK ✅\nRestart IINA to take effect";
/* Loading... */
"Loading..." = "Loading...";
3 changes: 3 additions & 0 deletions IINA+/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@

/* plugin install finish */
"PluginInstaller.tips" = "\n准备就绪 ✅\n重启 IINA 以生效";

/* Loading... */
"Loading..." = "加载中....";

0 comments on commit 6a6f88b

Please sign in to comment.