Added Pascal's Subsluts affiliate.

This commit is contained in:
DebaucheryLibrarian
2026-03-20 01:59:22 +01:00
parent 7e227a4ea5
commit a7df43eb55
6 changed files with 666 additions and 43 deletions

View File

@@ -31,13 +31,14 @@ const getFileEntries = require('./utils/file-entries');
const inspector = new Inspector();
let done = false;
unprint.options({
const unprintOptions = {
logErrors: false,
timeout: argv.requestTimeout,
userAgent: 'traxxx',
browserUserAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36',
apiUserAgent: 'traxxx',
clientRetirement: config.bypass.browser.clientRetirement,
// remote: config.bypass.remote,
limits: {
...config.limits,
default: {
@@ -47,10 +48,12 @@ unprint.options({
browser: config.limits.browser,
},
proxy: config.proxy,
});
};
unprint.on('requestInit', (event) => logger.debug(`Unprint ${event.method} (${event.interval}ms/${event.concurrency}p${event.isProxied ? ' proxied' : ''}${event.isBrowser ? ' browser' : ''}) ${event.url}`));
unprint.on('requestError', (event) => logger.error(`Unprint failed ${event.isProxied ? 'proxied ' : ''}${event.isBrowser ? 'browser ' : ''}${event.method} ${event.url} (${event.status}): ${event.statusText}`));
unprint.options(unprintOptions);
unprint.on('requestInit', (event) => logger.debug(`Unprint ${event.method} (${event.interval}ms/${event.concurrency}p${event.isRemote ? ' remote' : ''}${event.isProxied ? ' proxied' : ''}${event.isBrowser ? ' browser' : ''}) ${event.url}`));
unprint.on('requestError', (event) => logger.error(`Unprint failed ${event.isRemote ? ' remote' : ''}${event.isProxied ? 'proxied ' : ''}${event.isBrowser ? 'browser ' : ''}${event.method} ${event.url} (${event.status}): ${event.statusText}`));
unprint.on('browserOpen', (event) => logger.debug(`Unprint opened browsers ${event.keys} (${event.active}/${config.bypass.browser.clientRetirement} active, ${event.clients} clients)`));
unprint.on('browserClose', (event) => logger.debug(`Unprint closed${event.retired ? ' retired' : ''} browsers ${event.keys} (${event.active}/${config.bypass.browser.clientRetirement} active, ${event.clients} clients)`));
@@ -121,6 +124,14 @@ async function testProxy() {
throw new Error(`Proxy is offline (${res.status})`);
}
}
if (unprintOptions.remote.enable) {
await unprint.post(`${unprintOptions.remote.address}/options`, unprintOptions, {
headers: {
'unprint-key': unprintOptions.remote.key,
},
});
}
}
async function init() {

View File

@@ -14,8 +14,10 @@ function scrapeAll(months, channel, year) {
return unprint.initAll(scenes).map(({ query }) => {
const release = {};
release.url = query.url('a.video-pop-up', { origin: `${channel.origin}/submissive/` });
release.entryId = new URL(release.url).searchParams.get('id');
const videoUrl = query.url('a.video-pop-up', { origin: `${channel.origin}/submissive/` });
release.entryId = new URL(videoUrl).searchParams.get('id');
release.forceDeep = true;
release.title = query.content('.updates-item-title h4');
@@ -53,20 +55,24 @@ async function fetchLatest(channel, page = 1) {
return res.status;
}
function scrapeScene({ html }, url) {
function scrapeScene({ html }, baseRelease) {
const release = {};
release.entryId = new URL(url).searchParams.get('id');
release.entryId = baseRelease.entryId;
release.trailer = html.match(/file: '(.*)'/)[1];
return release;
}
async function fetchScene(url, channel) {
const res = await unprint.get(url);
async function fetchScene(_url, channel, baseRelease) {
if (!baseRelease.entryId) {
return null;
}
const res = await unprint.get(`${channel.origin}/submissive/player-load.php?id=${baseRelease.entryId}`);
if (res.ok) {
return scrapeScene(res.context, url, channel);
return scrapeScene(res.context, baseRelease);
}
return res.status;