mirror of
https://github.com/WebTools-NG/WebTools-NG
synced 2024-11-22 19:13:19 +00:00
Fix #586
This commit is contained in:
parent
667b75409c
commit
0c0298a402
2 changed files with 6 additions and 1 deletions
|
@ -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) => {
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue