diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..9de62fb Binary files /dev/null and b/.DS_Store differ diff --git a/Frameworks/.DS_Store b/Frameworks/.DS_Store new file mode 100644 index 0000000..305444c Binary files /dev/null and b/Frameworks/.DS_Store differ diff --git a/YT3Swift/.DS_Store b/YT3Swift/.DS_Store new file mode 100644 index 0000000..2361477 Binary files /dev/null and b/YT3Swift/.DS_Store differ diff --git a/YT3Swift/Downloader.swift b/YT3Swift/Downloader.swift index 34f2457..4cfe243 100644 --- a/YT3Swift/Downloader.swift +++ b/YT3Swift/Downloader.swift @@ -47,9 +47,9 @@ class Downloader { taskQueue.async { - let path = Bundle.main.path(forResource: downloaderVersion.rawValue, ofType: "sh") + let path = Bundle.main.path(forResource: downloaderVersion.rawValue, ofType: "") self.downloadTask = Process() - //self.downloadTask.environment?["python"] = "/usr/bin/python3" + if #available(OSX 10.13, *) { self.downloadTask.executableURL = URL(fileURLWithPath: path!) } else { @@ -79,9 +79,7 @@ class Downloader { self.isRunning = false } - - //if !audioOnly { - //print("GETTING STANDARD OUTPUT") + self.captureStandardOutput(self.downloadTask, progressHandler: {(percent) in progressHandler(percent, nil, nil) }, errorHandler: {(error) in @@ -92,27 +90,18 @@ class Downloader { progressHandler(100, error, self.currentVideo) }, infoHandler: {(videoInfo) in progressHandler(-1, nil, videoInfo) - //print("SENT \"\(videoInfo.name)\"") }) - // if !audioOnly { - //print("GETTING ERROR") self.readError(self.downloadTask, errorHandler: {(error) in progressHandler(100, error, self.currentVideo) }) - // } - + if #available(OSX 10.13, *) { try! self.downloadTask.run() } - //print("THREAD: \(Thread.current.name)") self.downloadTask.waitUntilExit() } - - /* } else { - print("Can't start download, task is already running") - }*/ } private func readError(_ task:Process, errorHandler: @escaping (Error) -> Void) { @@ -253,5 +242,5 @@ class Downloader { } enum YoutubeDLVersion: String { - case latest = "youtube-dl-2021-12-17" + case latest = "yt-dlp_macos" } diff --git a/YT3Swift/YoutubeDL/.DS_Store b/YT3Swift/YoutubeDL/.DS_Store new file mode 100644 index 0000000..b5f7aef Binary files /dev/null and b/YT3Swift/YoutubeDL/.DS_Store differ diff --git a/YT3Swift/YoutubeDL/youtube-dl-2021-06-06.sh b/YT3Swift/YoutubeDL/youtube-dl-2021-06-06.sh deleted file mode 100755 index 3417afc..0000000 Binary files a/YT3Swift/YoutubeDL/youtube-dl-2021-06-06.sh and /dev/null differ diff --git a/YT3Swift/YoutubeDL/yt-dlp_macos b/YT3Swift/YoutubeDL/yt-dlp_macos new file mode 100755 index 0000000..0d54f90 Binary files /dev/null and b/YT3Swift/YoutubeDL/yt-dlp_macos differ diff --git a/YoutubeToMac.entitlements b/YoutubeToMac.entitlements index 1640c97..b0e57b6 100644 --- a/YoutubeToMac.entitlements +++ b/YoutubeToMac.entitlements @@ -2,16 +2,6 @@ - com.apple.security.app-sandbox - - com.apple.security.files.downloads.read-write - - com.apple.security.files.user-selected.read-write - - com.apple.security.network.client - - com.apple.security.network.server - com.apple.security.temporary-exception.files.absolute-path.read-only /private/etc/apache2/ diff --git a/YoutubeToMac.xcodeproj/project.pbxproj b/YoutubeToMac.xcodeproj/project.pbxproj index cb1be03..2c03a2f 100644 --- a/YoutubeToMac.xcodeproj/project.pbxproj +++ b/YoutubeToMac.xcodeproj/project.pbxproj @@ -8,8 +8,8 @@ /* Begin PBXBuildFile section */ 23140B0D27948630009418C6 /* youtube-dl-2021-12-17.sh in Resources */ = {isa = PBXBuildFile; fileRef = 23140B0C27948630009418C6 /* youtube-dl-2021-12-17.sh */; }; - 23357A4326D9B9D20085CF13 /* youtube-dl-2021-06-06.sh in Resources */ = {isa = PBXBuildFile; fileRef = 23357A4226D9B9D20085CF13 /* youtube-dl-2021-06-06.sh */; }; 233DF4F424E4B2F60070F015 /* DownloadingPreferencesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 233DF4F324E4B2F60070F015 /* DownloadingPreferencesViewController.swift */; }; + 23C081272BFBB82D00CEDA73 /* yt-dlp_macos in Resources */ = {isa = PBXBuildFile; fileRef = 23C081262BFBB82D00CEDA73 /* yt-dlp_macos */; }; B7058DB822B6D392001E818D /* Downloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7058DB722B6D392001E818D /* Downloader.swift */; }; B7058DBA22B6DB20001E818D /* YTDownloadRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7058DB922B6DB20001E818D /* YTDownloadRequest.swift */; }; B77E6A651E9BCEFC001CFE77 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B77E6A641E9BCEFC001CFE77 /* AppDelegate.swift */; }; @@ -37,8 +37,8 @@ /* Begin PBXFileReference section */ 23140B0C27948630009418C6 /* youtube-dl-2021-12-17.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "youtube-dl-2021-12-17.sh"; sourceTree = ""; }; - 23357A4226D9B9D20085CF13 /* youtube-dl-2021-06-06.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "youtube-dl-2021-06-06.sh"; sourceTree = ""; }; 233DF4F324E4B2F60070F015 /* DownloadingPreferencesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DownloadingPreferencesViewController.swift; sourceTree = ""; }; + 23C081262BFBB82D00CEDA73 /* yt-dlp_macos */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = "yt-dlp_macos"; sourceTree = ""; }; B7058DB722B6D392001E818D /* Downloader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Downloader.swift; sourceTree = ""; }; B7058DB922B6DB20001E818D /* YTDownloadRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YTDownloadRequest.swift; sourceTree = ""; }; B77E6A611E9BCEFC001CFE77 /* YoutubeToMac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YoutubeToMac.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -78,8 +78,8 @@ B773BB5D2263E4AB00F24E37 /* YoutubeDL */ = { isa = PBXGroup; children = ( + 23C081262BFBB82D00CEDA73 /* yt-dlp_macos */, 23140B0C27948630009418C6 /* youtube-dl-2021-12-17.sh */, - 23357A4226D9B9D20085CF13 /* youtube-dl-2021-06-06.sh */, ); path = YoutubeDL; sourceTree = ""; @@ -214,10 +214,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 23C081272BFBB82D00CEDA73 /* yt-dlp_macos in Resources */, B77E6A691E9BCEFC001CFE77 /* Assets.xcassets in Resources */, B77E6A6C1E9BCEFC001CFE77 /* Main.storyboard in Resources */, 23140B0D27948630009418C6 /* youtube-dl-2021-12-17.sh in Resources */, - 23357A4326D9B9D20085CF13 /* youtube-dl-2021-06-06.sh in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -375,7 +375,7 @@ CODE_SIGN_IDENTITY = "Mac Developer"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 62; + CURRENT_PROJECT_VERSION = 63; DEVELOPMENT_TEAM = 9W7546BN3K; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -384,7 +384,7 @@ "$(PROJECT_DIR)/Frameworks", ); INFOPLIST_FILE = YT3Swift/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks $(inherited) @executable_path/../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.13; MARKETING_VERSION = 1.2.4; OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks"; @@ -403,7 +403,7 @@ CODE_SIGN_IDENTITY = "Mac Developer"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 62; + CURRENT_PROJECT_VERSION = 63; DEVELOPMENT_TEAM = 9W7546BN3K; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -412,7 +412,7 @@ "$(PROJECT_DIR)/Frameworks", ); INFOPLIST_FILE = YT3Swift/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks $(inherited) @executable_path/../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.13; MARKETING_VERSION = 1.2.4; OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks"; diff --git a/YoutubeToMac.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/YoutubeToMac.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/YoutubeToMac.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/YoutubeToMac.xcodeproj/project.xcworkspace/xcuserdata/jake.xcuserdatad/UserInterfaceState.xcuserstate b/YoutubeToMac.xcodeproj/project.xcworkspace/xcuserdata/jake.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..5aad382 Binary files /dev/null and b/YoutubeToMac.xcodeproj/project.xcworkspace/xcuserdata/jake.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/YoutubeToMac.xcodeproj/project.xcworkspace/xcuserdata/spannja.xcuserdatad/UserInterfaceState.xcuserstate b/YoutubeToMac.xcodeproj/project.xcworkspace/xcuserdata/spannja.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..19f5bc1 Binary files /dev/null and b/YoutubeToMac.xcodeproj/project.xcworkspace/xcuserdata/spannja.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/YoutubeToMac.xcodeproj/xcuserdata/jake.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/YoutubeToMac.xcodeproj/xcuserdata/jake.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..8116f0c --- /dev/null +++ b/YoutubeToMac.xcodeproj/xcuserdata/jake.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,40 @@ + + + + + + + + + + + + + diff --git a/YoutubeToMac.xcodeproj/xcuserdata/jake.xcuserdatad/xcschemes/xcschememanagement.plist b/YoutubeToMac.xcodeproj/xcuserdata/jake.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..76fa4c0 --- /dev/null +++ b/YoutubeToMac.xcodeproj/xcuserdata/jake.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,35 @@ + + + + + SchemeUserState + + Playground (Playground) 1.xcscheme + + isShown + + orderHint + 2 + + Playground (Playground) 2.xcscheme + + isShown + + orderHint + 3 + + Playground (Playground).xcscheme + + isShown + + orderHint + 1 + + YoutubeToMac.xcscheme_^#shared#^_ + + orderHint + 0 + + + +