Fixed Vixen scraper, using new token URL for trailers.

This commit is contained in:
2020-04-26 03:51:59 +02:00
parent 2cfbd21560
commit 2ac879d276
5 changed files with 313 additions and 97 deletions

View File

@@ -45,7 +45,7 @@ queue.define('http', async ({
options = {},
}) => {
if (body) {
logger.silly(`${method.toUpperCase()} ${url} with ${body}`);
logger.silly(`${method.toUpperCase()} ${url} with ${JSON.stringify(body)}`);
} else {
logger.silly(`${method.toUpperCase()} ${url}`);
}
@@ -73,8 +73,10 @@ queue.define('http', async ({
return {
...res,
originalRes: res,
html,
json,
pipe: res.pipe,
ok: res.statusCode >= 200 && res.statusCode <= 299,
code: res.statusCode,
status: res.statusCode,
@@ -85,7 +87,7 @@ queue.define('http', async ({
async function get(url, headers, options) {
return queue.push('http', {
method: 'get',
method: 'GET',
url,
headers,
options,
@@ -94,6 +96,7 @@ async function get(url, headers, options) {
async function post(url, body, headers, options) {
return queue.push('http', {
method: 'POST',
url,
body,
headers,