diff --git a/modules/BinaryUpdater.js b/modules/BinaryUpdater.js index d9647629..276c0d60 100644 --- a/modules/BinaryUpdater.js +++ b/modules/BinaryUpdater.js @@ -72,11 +72,11 @@ class BinaryUpdater { return null; } if (res.status === 302) { - const versionRegex = res.data.match(/[0-9]+\.[0-9]+\.[0-9]+/); - const urlRegex = res.data.match(/(?<=").+?(?=")/); + const redirectUrl = res.headers.location; + const versionRegex = redirectUrl.match(/[0-9]+\.[0-9]+\.[0-9]+/); return { remoteVersion: versionRegex ? versionRegex[0] : null, - remoteUrl: urlRegex ? urlRegex[0] : null, + remoteUrl: redirectUrl, }; } else { console.error('Did not get redirect for the latest version link. Status: ' + err.response.status); diff --git a/modules/Filepaths.js b/modules/Filepaths.js index 283fd51f..cba0df62 100644 --- a/modules/Filepaths.js +++ b/modules/Filepaths.js @@ -56,7 +56,7 @@ class Filepaths { this.packedPrefix = this.appPath; this.unpackedPrefix = this.appPath + ".unpacked"; this.ffmpeg = this.app.isPackaged ? path.join(this.unpackedPrefix, "binaries") : "binaries"; - this.ytdl = this.app.isPackaged ? path.join(this.unpackedPrefix, "binaries/yt-dlp-unix") : "binaries/yt-dlp-unix"; + this.ytdl = this.app.isPackaged ? path.join(this.unpackedPrefix, "binaries/yt-dlp_macos") : "binaries/yt-dlp_macos"; this.icon = this.app.isPackaged ? path.join(this.packedPrefix, "renderer/img/icon.png") : "renderer/img/icon.png"; this.settings = this.app.isPackaged ? path.join(this.unpackedPrefix, "userSettings") : "userSettings"; this.taskList = this.app.isPackaged ? path.join(this.unpackedPrefix, "taskList") : "taskList"; @@ -69,7 +69,7 @@ class Filepaths { this.packedPrefix = this.appPath; this.unpackedPrefix = this.appPath + ".unpacked"; if(this.app.isPackaged) await this.createFolder(this.persistentPath); - this.ytdl = this.app.isPackaged ? path.join(this.persistentPath, "yt-dlp-unix") : "binaries/yt-dlp-unix"; + this.ytdl = this.app.isPackaged ? path.join(this.persistentPath, "yt-dlp") : "binaries/yt-dlp"; this.ffmpeg = this.app.isPackaged ? this.persistentPath : "binaries"; this.icon = this.app.isPackaged ? path.join(this.packedPrefix, "renderer/img/icon.png") : "renderer/img/icon.png"; this.settings = this.app.isPackaged ? path.join(this.persistentPath, "userSettings") : "userSettings"; diff --git a/tests/BinaryUpdater.test.js b/tests/BinaryUpdater.test.js index abeab5bf..7324ef09 100644 --- a/tests/BinaryUpdater.test.js +++ b/tests/BinaryUpdater.test.js @@ -67,7 +67,6 @@ describe('getRemoteVersion', () => { const axiosGetSpy = jest.spyOn(axios, 'get').mockRejectedValue({ response: { status: 302, - data: "", headers: { location: redirectURL }