mirror of
https://github.com/Tusko/vimeo-private-downloader.git
synced 2025-08-02 21:04:37 -07:00
feat: Better error handling on segment download side
This commit is contained in:
parent
9987b838b6
commit
b8fe708f77
1 changed files with 4 additions and 0 deletions
4
index.js
4
index.js
|
@ -122,6 +122,10 @@ function combineSegments(type, i, segmentsUrl, output, filename, downloadingFlag
|
||||||
|
|
||||||
let req = https
|
let req = https
|
||||||
.get(segmentsUrl[i], res => {
|
.get(segmentsUrl[i], res => {
|
||||||
|
if (res.statusCode != 200) {
|
||||||
|
cb(new Error(`Downloading segment with url '${segmentsUrl[i]}' failed with status: ${res.statusCode} ${res.statusMessage}`))
|
||||||
|
}
|
||||||
|
|
||||||
res.on("data", d => output.write(d));
|
res.on("data", d => output.write(d));
|
||||||
|
|
||||||
res.on("end", () =>
|
res.on("end", () =>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue