Added the awkward pagination to PornCZ scraper.

This commit is contained in:
DebaucheryLibrarian
2020-07-23 00:55:55 +02:00
parent 46c6c4dd21
commit 9ef5ea8fb6
5 changed files with 29 additions and 12 deletions

View File

@@ -65,8 +65,8 @@ async function handler({
}
const res = ['POST', 'PUT', 'PATCH'].includes(method.toUpperCase())
? await bhttp[method.toLowerCase()](url, body, reqOptions)
: await bhttp[method.toLowerCase()](url, reqOptions);
? await (options.useSession || bhttp)[method.toLowerCase()](url, body, reqOptions)
: await (options.useSession || bhttp)[method.toLowerCase()](url, reqOptions);
if (options?.stream && options?.destination) {
await pipeline(res, ...(options?.transforms || []), options?.destination);
@@ -131,8 +131,16 @@ async function post(url, body, headers, options) {
});
}
function session(headers, options) {
return bhttp.session({
headers,
options,
});
}
module.exports = {
get,
post,
head,
session,
};

View File

@@ -435,6 +435,8 @@ module.exports = {
formatDate,
get,
getAll,
fetch: get,
fetchAll: getAll,
context: init,
contextAll: initAll,
ed: extractDate,