Disable unprint browser re-use by default to observe memory effect. Fixed media throttling argument in http module.

This commit is contained in:
DebaucheryLibrarian 2026-01-02 01:13:20 +01:00
parent 373c0a9e25
commit a08d091989
3 changed files with 22 additions and 2 deletions

View File

@ -35,6 +35,7 @@ unprint.options({
headers: { headers: {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36',
}, },
scope: null, // don't reuse browser
context: { context: {
// browser requests // browser requests
userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36', userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36',

View File

@ -5,6 +5,7 @@ const Promise = require('bluebird');
const { CookieJar } = Promise.promisifyAll(require('tough-cookie')); const { CookieJar } = Promise.promisifyAll(require('tough-cookie'));
const cookie = require('cookie'); const cookie = require('cookie');
const moment = require('moment'); const moment = require('moment');
const unprint = require('unprint');
const qu = require('../utils/qu'); const qu = require('../utils/qu');
const slugify = require('../utils/slugify'); const slugify = require('../utils/slugify');
@ -140,7 +141,11 @@ function scrapeRelease(data, url, channel, networkName, options) {
release.actors = data.actors.map((actor) => ({ name: actor.name, gender: actor.gender })); release.actors = data.actors.map((actor) => ({ name: actor.name, gender: actor.gender }));
release.tags = data.tags.map((tag) => tag.name); release.tags = data.tags.map((tag) => tag.name);
[release.poster, ...release.photos] = getThumbs(data); [release.poster, ...release.photos] = getThumbs(data).map((src) => ({
src,
referer: url,
host: 'mediavault-private-fl.project1content.com',
}));
const { teaser, trailer } = getVideos(data); const { teaser, trailer } = getVideos(data);
@ -181,6 +186,9 @@ function scrapeRelease(data, url, channel, networkName, options) {
})); }));
} }
// console.log(data);
// console.log(release);
return release; return release;
} }
@ -220,6 +228,17 @@ async function getSession(site, parameters, url) {
? site.parent.url ? site.parent.url
: (url || site.url); : (url || site.url);
/*
await unprint.browserRequest(sessionUrl, {
browser: {
headless: false,
},
async control() {
await new Promise((resolve) => { setTimeout(() => resolve(), 10000); });
},
});
*/
const res = await http.get(sessionUrl, { const res = await http.get(sessionUrl, {
session, session,
headers: { headers: {

View File

@ -119,7 +119,7 @@ function getLimiterValue(prop, options, hostname) {
const mappedProp = propMap[options.limits]?.[prop] || prop; const mappedProp = propMap[options.limits]?.[prop] || prop;
if (typeof argv[mappedProp] !== 'undefined') { if (typeof argv[mappedProp] !== 'undefined') {
return argv[prop]; return argv[mappedProp];
} }
if (typeof options[prop] !== 'undefined') { if (typeof options[prop] !== 'undefined') {