This commit is contained in:
NoLogicAlan committed 2026-05-28 17:40:18 +03:00
1 parent 9e363c9ccf
commit 5a29545d41
14 files changed
+116 -50

No files matched your search

+2 -2
View File
@@ -43,7 +43,7 @@ class Tuna {
results.items = results.items.map(s => {
s.download = function() {
return new Promise((resolve, reject) => {
const req = https.get(this.oggPath, (r) => { resolve(r); });
const req = https.get(this.oggPath, { maxRedirects: 20 }, (r) => { resolve(r); });
req.on("error", (err) => { reject(err); });
req.setTimeout(15_000, () => { req.destroy(); reject(new Error("Tuna download timeout")); });
});
@@ -57,7 +57,7 @@ class Tuna {
return this.get("/v1/sounds/" + id).then(sound => {
sound.download = function() {
return new Promise((resolve, reject) => {
const req = https.get(this.oggPath, (result) => { resolve(result); });
const req = https.get(this.oggPath, { maxRedirects: 20 }, (result) => { resolve(result); });
req.on("error", (err) => { reject(err); });
req.setTimeout(15_000, () => { req.destroy(); reject(new Error("Tuna download timeout")); });
});