Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
xjbeta committed Feb 21, 2023
2 parents 62357a0 + 7abf9e7 commit ac9c169
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions IINA+.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.6.23;
MARKETING_VERSION = 0.6.24;
PRODUCT_BUNDLE_IDENTIFIER = "com.xjbeta.iina-plus";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -993,7 +993,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.6.23;
MARKETING_VERSION = 0.6.24;
PRODUCT_BUNDLE_IDENTIFIER = "com.xjbeta.iina-plus";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
6 changes: 3 additions & 3 deletions IINA+/Utils/VideoDecoder/DouYin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ class DouYin: NSObject, SupportSiteProtocol {
$0.domain.contains("douyin")
}

return webview.evaluateJavaScript("self.webpackChunkmy_app.length").then { length -> Promise<()> in
// print("length: \(length)")
if let l = length as? Int, l > 36 {
return webview.evaluateJavaScript("self.webpackChunkdouyin_live_v2.length").then { length -> Promise<()> in
// print("douyin checker, length: \(length)")
if let l = length as? Int, l > 30 {
dyCookies.forEach {
self.cookies[$0.name] = $0.value
}
Expand Down
16 changes: 11 additions & 5 deletions IINA+/Views/MainWindow/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ class MainViewController: NSViewController {
guard bookmarkTableView.selectedRow != -1 else { return }
let url = bookmarks[bookmarkTableView.selectedRow].url
searchField.stringValue = url
startSearchingUrl(url)

let option = NSEvent.modifierFlags.contains(.option)
startSearchingUrl(url, with: option)
}

// MARK: - Menu
Expand Down Expand Up @@ -414,7 +416,9 @@ class MainViewController: NSViewController {
}


func startSearchingUrl(_ url: String, directly: Bool = false) {
func startSearchingUrl(_ url: String,
directly: Bool = false,
with option: Bool = false) {
guard url != "" else { return }
Processes.shared.stopDecodeURL()
waitingErrorMessage = nil
Expand All @@ -438,7 +442,7 @@ class MainViewController: NSViewController {
str = $0
}
}.then {
self.decodeUrl($0, directly: directly)
self.decodeUrl($0, directly: directly, with: option)
}.ensure {
self.isSearching = false
self.progressStatusChanged(false)
Expand Down Expand Up @@ -466,7 +470,9 @@ class MainViewController: NSViewController {
}
}

func decodeUrl(_ url: String, directly: Bool = false) -> Promise<()> {
func decodeUrl(_ url: String,
directly: Bool = false,
with option: Bool = false) -> Promise<()> {

return Promise { resolver in
let videoGet = Processes.shared.videoDecoder
Expand All @@ -486,7 +492,7 @@ class MainViewController: NSViewController {
}.then { _ in
Processes.shared.decodeURL(str)
}.done(on: .main) {
if Preferences.shared.autoOpenResult {
if Preferences.shared.autoOpenResult && !option {
self.open(result: $0, row: 0).catch {
Log("Prepare DM file error : \($0)")
}
Expand Down

0 comments on commit ac9c169

Please sign in to comment.