This commit is contained in:
Tommy Mikkelsen 2022-09-04 23:25:26 +02:00
parent 667b75409c
commit 0c0298a402
2 changed files with 6 additions and 1 deletions

View file

@ -128,6 +128,7 @@ ipcMain.on('downloadFile', function (event, data) {
axios({ axios({
method: 'GET', method: 'GET',
url: item, url: item,
headers: data.header,
responseType: 'stream', responseType: 'stream',
httpsAgent: agent httpsAgent: agent
}).then((response) => { }).then((response) => {

View file

@ -1163,6 +1163,9 @@ const etHelper = new class ETHELPER {
} }
async forceDownload( { url: url, target: target, title: title } ) { async forceDownload( { url: url, target: target, title: title } ) {
let header = wtutils.PMSHeader;
header['X-Plex-Token'] = store.getters.getSelectedServer.accessToken;
const _this = this; const _this = this;
return new Promise((resolve) => { return new Promise((resolve) => {
try try
@ -1170,7 +1173,8 @@ const etHelper = new class ETHELPER {
_this.isDownloading = true; _this.isDownloading = true;
ipcRenderer.send('downloadFile', { ipcRenderer.send('downloadFile', {
item: url, item: url,
filePath: target filePath: target,
header: header
}) })
} }
catch (error) catch (error)