fixes and optimizations

This commit is contained in:
zefie
2025-08-11 17:42:57 -04:00
parent b95f58b381
commit e4aac5933e
9 changed files with 245 additions and 246 deletions

View File

@@ -1042,7 +1042,7 @@ class WebTVClientSimulator {
this.followVisit(headers['wtv-visit'])
.then(resolve)
.catch(reject);
}, this.requestDelay);
}, this.requestDelay);
return;
} else {
this.debugLog(`Skipping wtv-visit redirect: ${headers['wtv-visit']}`);
@@ -1252,7 +1252,7 @@ class WebTVClientSimulator {
} else {
// Detect text content for CLI output
const contentType = result.headers['content-type'] || '';
if (/^text\//.test(contentType) || /json|xml|javascript|download-list/.test(contentType)) {
if (/^text\//.test(contentType) || /json|xml|javascript||download-list/.test(contentType) || contentType === "x-wtv-addresses") {
console.log(result.body.toString('utf8'));
} else if (result.body.length === 0) {
console.log('<empty response>');