Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function calcPercents(current, max) {
return ((current / max) * 100).toFixed(1);
}

export default async function downloadFile(url, outputPath, subtask, videoId) {
export default async function downloadFile(url, outputPath, subtask, videoId, proxyData) {
if (!url) {
throw new Error("Invalid download link");
}
Expand All @@ -17,6 +17,7 @@ export default async function downloadFile(url, outputPath, subtask, videoId) {
method: "get",
url: url,
responseType: "stream",
proxy: proxyData || false,
});

const totalLength = headers["content-length"];
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ async function main() {
`${OUTPUT_DIR}/${filename}`,
subtask,
`(ID: ${videoId} as ${filename})`,
proxyData,
)
.then(() => {
subtask.title = `Download ${taskSubTitle} completed!`;
Expand Down Expand Up @@ -411,6 +412,7 @@ async function main() {
`${OUTPUT_DIR}/${filename}`,
subtask,
`(ID: ${videoId} as ${filename})`,
proxyData,
)
.then(() => {
subtask.title = `Download ${taskSubTitle} completed!`;
Expand Down