Fix playlist wrong download dir
This commit is contained in:
parent
74d33d5181
commit
6515ebf39b
@ -175,6 +175,7 @@
|
||||
<div id="list">
|
||||
</div>
|
||||
|
||||
<!-- <button class="advancedToggle" id="finishBtn">Finish downloading</button> -->
|
||||
<div id="goToTop"></div>
|
||||
</body>
|
||||
|
||||
|
@ -13,7 +13,7 @@ let downloadDir = localStorage.getItem("downloadPath") || downloadsDir;
|
||||
try {
|
||||
console.log("Trying to access", downloadDir)
|
||||
fs.accessSync(downloadDir, constants.W_OK);
|
||||
downloadDir = downloadsDir;
|
||||
downloadDir = downloadDir;
|
||||
} catch (err) {
|
||||
console.log("Unable to write to download directory. Switching to default one.")
|
||||
console.log("Err:", err)
|
||||
@ -305,6 +305,14 @@ function download(type) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
getId("finishBtn").addEventListener("click", () => {
|
||||
controller.abort("user_finished")
|
||||
try {
|
||||
process.kill(downloadProcess.ytDlpProcess.pid, 'SIGHINT')
|
||||
} catch (_error) {}
|
||||
})
|
||||
|
||||
downloadProcess.on("ytDlpEvent", (_eventType, eventData) => {
|
||||
// console.log(eventData);
|
||||
|
||||
|
@ -401,7 +401,7 @@ async function getInfo(url) {
|
||||
* @typedef {import("./types").format} format
|
||||
* @type {format[]}
|
||||
*/
|
||||
const formats = parsedInfo.formats;
|
||||
const formats = parsedInfo.formats || [];
|
||||
console.log(formats);
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user