56 Commits

Author SHA1 Message Date
DebaucheryLibrarian
0560fac1ff 1.250.38 2026-03-13 05:14:45 +01:00
DebaucheryLibrarian
108bf3b168 Integrated manticore stash sync tool. 2026-03-13 05:14:42 +01:00
DebaucheryLibrarian
155e235246 Fixed Aylo specifying wrong host for media. 2026-03-10 05:54:00 +01:00
DebaucheryLibrarian
bff665c6ec 1.250.37 2026-03-10 04:41:36 +01:00
DebaucheryLibrarian
c7111329dc Improved knex error reporting. 2026-03-10 04:41:30 +01:00
DebaucheryLibrarian
d7c1c0ae5c 1.250.36 2026-03-09 05:36:21 +01:00
DebaucheryLibrarian
ea298d7edb Fixed Aylo scraper ignoring session configuration. 2026-03-09 05:36:17 +01:00
DebaucheryLibrarian
99dfcae920 1.250.35 2026-03-08 04:03:57 +01:00
DebaucheryLibrarian
24cba1e1fa Deleting flushed scenes from manticore. 2026-03-08 04:03:55 +01:00
DebaucheryLibrarian
076bdad310 1.250.34 2026-03-06 04:25:55 +01:00
DebaucheryLibrarian
d432d291dd Added See Him Solo to Hussie Pass, added HP affiliates. 2026-03-06 04:25:51 +01:00
DebaucheryLibrarian
220f7e787d 1.250.33 2026-03-05 02:00:53 +01:00
DebaucheryLibrarian
f1caa77e4b Added scene tags table to manticore scenes tool. 2026-03-05 02:00:43 +01:00
DebaucheryLibrarian
ff633436cb 1.250.32 2026-03-04 02:53:21 +01:00
DebaucheryLibrarian
6860072a51 Added database support for actor-specific scene tags. 2026-03-04 02:53:17 +01:00
DebaucheryLibrarian
2c7b4cfc22 1.250.31 2026-03-04 01:57:39 +01:00
DebaucheryLibrarian
7d9e1be8d4 Added Lesbian Factor. 2026-03-04 01:57:33 +01:00
DebaucheryLibrarian
00db4b1b5b 1.250.30 2026-03-03 23:47:50 +01:00
DebaucheryLibrarian
9f1cf1575a Added ASG Max channel parameters. 2026-03-03 23:47:48 +01:00
DebaucheryLibrarian
4f13e4ed28 1.250.29 2026-03-03 23:11:33 +01:00
DebaucheryLibrarian
9805aa7b5b Added Deep Inside to Disruptive Films. Added Sodomy Squad affiliate. 2026-03-03 23:11:32 +01:00
DebaucheryLibrarian
0cc6ebc305 1.250.28 2026-03-03 22:40:52 +01:00
DebaucheryLibrarian
016c24af28 Added channel filter option to Gamma scraper, re-added Disruptive Films channel. 2026-03-03 22:40:49 +01:00
DebaucheryLibrarian
2158550091 1.250.27 2026-03-03 01:21:00 +01:00
DebaucheryLibrarian
68ddc8cb78 Added Wicked affiliate. Improved Gamma banner tool filename composition. 2026-03-03 01:20:58 +01:00
DebaucheryLibrarian
bc5693e44a 1.250.26 2026-03-02 23:55:11 +01:00
DebaucheryLibrarian
7276d90629 Disabled tags by default in Gamma banner tool filenames. Added Gangbang Creampie, Gloryhole Secrets and Taboo Heat affiliates. 2026-03-02 23:55:09 +01:00
DebaucheryLibrarian
1a1af95a10 1.250.25 2026-03-02 22:36:08 +01:00
DebaucheryLibrarian
bcb7a56588 Added alt descriptions and attributes columns to series. 2026-03-02 22:36:05 +01:00
DebaucheryLibrarian
16648d50f6 Re-enabled filename actors and tags in Gamma banner tool, improved disable argument. 2026-03-02 06:24:54 +01:00
DebaucheryLibrarian
062dc0e75e 1.250.24 2026-03-02 06:21:30 +01:00
DebaucheryLibrarian
42effd53fc Added Diabolic affiliate. Disabled filename actors and tags in Gamma banner tool, unreliable. 2026-03-02 06:21:27 +01:00
DebaucheryLibrarian
3a3403bb1f 1.250.23 2026-03-02 06:07:49 +01:00
DebaucheryLibrarian
6fb4989256 Added Chaos Men affiliate. 2026-03-02 06:07:45 +01:00
DebaucheryLibrarian
9750ca4b79 1.250.22 2026-03-02 05:52:48 +01:00
DebaucheryLibrarian
0500f7eda8 Added Burning Angel affiliate. Fixed Gamma banner tool breaking on invalid URL. 2026-03-02 05:52:46 +01:00
DebaucheryLibrarian
19beff7dbc 1.250.21 2026-03-02 05:38:52 +01:00
DebaucheryLibrarian
dfe1b84992 Explicitly unsetting channel parent in seed. 2026-03-02 05:38:50 +01:00
DebaucheryLibrarian
3d3b544cb4 1.250.20 2026-03-02 05:07:26 +01:00
DebaucheryLibrarian
65fa6027ee Prioritized pissing tag. 2026-03-02 05:07:23 +01:00
DebaucheryLibrarian
b3a0ba72eb 1.250.19 2026-03-02 04:01:41 +01:00
DebaucheryLibrarian
f3e2143b45 Fixed wrong date parse function call in Gamma scraper. Added Biphoria affiliate link. 2026-03-02 04:01:39 +01:00
DebaucheryLibrarian
d289f95d3d 1.250.18 2026-03-02 03:46:48 +01:00
DebaucheryLibrarian
d8b41ec9b5 Use request interface for Vixen deep fetch, seemingly less chance of a 403. 2026-03-02 03:46:46 +01:00
DebaucheryLibrarian
05f7d8b814 1.250.17 2026-03-02 03:27:27 +01:00
DebaucheryLibrarian
c2fc09fdaa Removed redundant program filter from Gamma banner tool. 2026-03-02 03:27:24 +01:00
DebaucheryLibrarian
8a7210a3b9 1.250.16 2026-03-02 03:08:28 +01:00
DebaucheryLibrarian
e029ca7fd0 Added Gamma banner downloader. 2026-03-02 03:08:26 +01:00
DebaucheryLibrarian
ffcfae69d5 1.250.15 2026-03-02 03:07:12 +01:00
DebaucheryLibrarian
dcaee01ce8 Using channel origin instead of URL for Gamma referer URL composition. 2026-03-02 03:07:10 +01:00
DebaucheryLibrarian
7561a4577e 1.250.14 2026-03-02 01:41:38 +01:00
DebaucheryLibrarian
98b735dbae Added Vivid and Zero Tolerance affiliate links. Restored BAM Visions profile scraper, site is back online. 2026-03-02 01:41:36 +01:00
DebaucheryLibrarian
d2daed788c 1.250.13 2026-03-02 01:14:27 +01:00
DebaucheryLibrarian
23257745a7 Fixed profile updated_at timestamp not updating. 2026-03-02 01:14:23 +01:00
DebaucheryLibrarian
156954553d 1.250.12 2026-03-02 01:06:31 +01:00
DebaucheryLibrarian
eb20af14a6 Improved Gamma scene URL composition. 2026-03-02 01:06:29 +01:00
23 changed files with 621 additions and 66 deletions

View File

@@ -27,7 +27,7 @@
"require-await": "off",
"no-param-reassign": ["error", {
"props": true,
"ignorePropertyModificationsFor": ["state", "acc", "req"]
"ignorePropertyModificationsFor": ["state", "acc", "req", "error"]
}]
},
"globals": {

View File

@@ -188,6 +188,8 @@ module.exports = {
'wishescumtrue',
// hentaied
'somegore',
// digital playground
'digitalplayground', // no longer updates, produces a bunch of garbage for some reason
],
networks: [
// dummy network for testing
@@ -279,7 +281,7 @@ module.exports = {
trailerQuality: [540, 720, 960, 480, 1080, 360, 320, 1440, 1600, 1920, 2160, 270, 240, 180],
limit: 25, // max number of photos per release
attempts: 2,
flushOrphaned: true,
flushOrphaned: false,
flushWindow: 1000,
streams: {
enabled: true, // fetch streams

View File

@@ -0,0 +1,13 @@
exports.up = async function(knex) {
await knex.schema.alterTable('series', (table) => {
table.specificType('alt_descriptions', 'text ARRAY');
table.json('attributes');
});
};
exports.down = async function(knex) {
await knex.schema.alterTable('series', (table) => {
table.dropColumn('alt_descriptions');
table.dropColumn('attributes');
});
};

View File

@@ -0,0 +1,21 @@
exports.up = async function(knex) {
await knex.schema.alterTable('releases_tags', (table) => {
table.integer('actor_id')
.references('id')
.inTable('actors');
table.dropUnique(['tag_id', 'release_id']);
});
await knex.raw('CREATE UNIQUE INDEX releases_tags_tag_id_release_id_actor_id ON releases_tags (tag_id, release_id, COALESCE(actor_id, -1))');
};
exports.down = async function(knex) {
await knex.schema.alterTable('releases_tags', (table) => {
table.dropColumn('actor_id');
table.unique(['tag_id', 'release_id']);
});
await knex.raw('DROP INDEX IF EXISTS releases_tags_tag_id_release_id_actor_id');
};

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "traxxx",
"version": "1.250.11",
"version": "1.250.38",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "traxxx",
"version": "1.250.11",
"version": "1.250.38",
"license": "ISC",
"dependencies": {
"@aws-sdk/client-s3": "^3.458.0",

View File

@@ -1,6 +1,6 @@
{
"name": "traxxx",
"version": "1.250.11",
"version": "1.250.38",
"description": "All the latest porn releases in one place",
"main": "src/app.js",
"scripts": {

View File

@@ -3024,6 +3024,8 @@ const priorities = [ // higher index is higher priority
['blowbang', 'orgy'],
['gangbang'],
['gay', 'transsexual', 'bisexual', 'hentai'],
['pissing'],
['compilation', 'bts'],
].reduce((acc, slugs, index) => {
slugs.forEach((slug) => { acc[slug] = index; });

View File

@@ -840,6 +840,9 @@ const networks = [
url: 'https://www.vivid.com',
description: 'Home of the Kim Kardashian Sex Tape, Porn Parodies, and over 30,000 XXX Movies from The World Leader In Adult Entertainment.',
parent: 'gamma',
parameters: {
sceneMovies: false,
},
},
{
slug: 'vixen',

View File

@@ -609,6 +609,9 @@ const sites = [
slug: 'asgmaxoriginals',
url: 'https://www.asgmax.com/en/channel/asgmaxoriginals',
parent: 'asgmax',
parameters: {
queryChannel: 'asgmaxoriginals',
},
},
{
name: 'ASG Max Films',
@@ -616,6 +619,9 @@ const sites = [
url: 'https://www.asgmax.com/en/channel/asgmaxfilms',
parent: 'asgmax',
hasLogo: false,
parameters: {
queryChannel: 'asgmaxfilms',
},
},
{
name: 'ASG International',
@@ -623,6 +629,9 @@ const sites = [
url: 'https://www.asgmax.com/en/channel/asginternational',
parent: 'asgmax',
hasLogo: false,
parameters: {
queryChannel: 'asginternational',
},
},
{
name: 'ASG Massage',
@@ -631,6 +640,9 @@ const sites = [
parent: 'asgmax',
tags: ['massage'],
hasLogo: false,
parameters: {
queryChannel: 'asgmassage',
},
},
{
name: 'ASG Auditions',
@@ -639,6 +651,9 @@ const sites = [
parent: 'asgmax',
tags: ['audition'],
hasLogo: false,
parameters: {
queryChannel: 'asgauditions',
},
},
{
name: 'ASG Free Use',
@@ -647,6 +662,9 @@ const sites = [
parent: 'asgmax',
tags: ['free-use'],
hasLogo: false,
parameters: {
queryChannel: 'asgfreeuse',
},
},
{
name: 'Exeter Hill College',
@@ -655,6 +673,9 @@ const sites = [
parent: 'asgmax',
hasLogo: false,
tags: ['animated'],
parameters: {
queryChannel: 'asgexeterhillcollege',
},
},
// ASG MAX INDEPENDENT
{
@@ -1018,12 +1039,12 @@ const sites = [
{
name: 'Disruptive Films',
slug: 'disruptivefilms',
delete: true,
url: 'https://www.disruptivefilms.com',
parent: 'disruptivefilms',
tags: ['gay'],
parameters: {
queryChannel: 'asgmaxdisruptivefilms',
filterChannel: 'asgmaxdisruptivefilms',
},
},
{
@@ -1070,6 +1091,17 @@ const sites = [
queryChannel: 'asgmaxtruemale',
},
},
{
name: 'Deep Inside',
slug: 'deepinside',
url: 'https://www.asgmax.com/en/channel/asgmaxdeepinside',
parent: 'disruptivefilms',
tags: ['gay'],
hasLogo: false,
parameters: {
queryChannel: 'asgmaxdeepinside',
},
},
// AMATEUR ALLURE
{
name: 'Amateur Allure',
@@ -5422,6 +5454,12 @@ const sites = [
referer: 'https://www.girlsway.com',
},
},
{
slug: 'lesbianfactor',
name: 'Lesbian Factor',
url: 'https://www.lesbianfactor.com',
parent: 'girlsway',
},
// HITZEFREI
{
slug: 'unleashed',
@@ -5532,6 +5570,16 @@ const sites = [
latest: 'https://seehimfuck.com',
},
},
{
slug: 'seehimsolo',
name: 'See Him Solo',
url: 'https://seehimsolo.com',
tags: ['male-focus', 'solo'],
parent: 'hussiepass',
parameters: {
latest: 'https://seehimsolo.com/categories/movies-2/{page}/latest/',
},
},
{
slug: 'interracialpovs',
name: 'Interracial POVs',
@@ -10511,10 +10559,11 @@ const sites = [
name: 'Look At Her Now',
url: 'https://www.lookathernow.com',
description: 'Look At Her Now brings you best HD reality porn videos every week. Check out these girls before and after they get some rough pounding.',
parameters: { native: true },
// parameters: { siteId: 300 },
slug: 'lookathernow',
parent: 'realitykings',
parameters: {
siteId: 364,
},
},
{
name: 'We Live Together',
@@ -15534,7 +15583,7 @@ exports.seed = (knex) => Promise.resolve()
url: site.url,
parameters: site.parameters || null,
options: site.options,
parent_id: networksMap[site.parent],
parent_id: networksMap[site.parent] || null,
priority: site.priority || 0,
independent: !!site.independent,
visible: site.visible,

View File

@@ -208,6 +208,11 @@ const affiliates = [
url: 'https://www.g2buddy.com/disruptivefilms/go.php?pr=9&su=2&si=119&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
},
{
channel: 'sodomysquad',
url: 'https://www.g2buddy.com/sodomysquad/go.php?pr=9&su=2&si=137&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
},
// gamma > ags max > next door studios
// excluded affiliate links that link back to main site and don't seem to track properly
{
@@ -494,6 +499,92 @@ const affiliates = [
scene: false, // redirects to Adult Time
},
},
// gamma > vivid
{
network: 'vivid',
url: 'https://www.g2fame.com/vivid/go.php?pr=8&su=2&si=330&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
parameters: {
scene: false, // redirects to homepage
},
},
{
channel: 'wheretheboysarent',
url: 'https://www.g2fame.com/wheretheboysarent/go.php?pr=8&su=2&si=368&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
},
{
channel: 'thebrats',
url: 'https://www.g2fame.com/thebrats/go.php?pr=8&su=2&si=369&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
},
// gamma > zero tolerance
{
network: 'zerotolerance',
url: 'https://www.g2fame.com/zerotolerancefilms/go.php?pr=8&su=2&si=507&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
},
{
channel: 'zerotolerancefilms',
url: 'https://www.g2fame.com/zerotolerancefilms/go.php?pr=8&su=2&si=507&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
},
{
channel: '3rddegreefilms',
url: 'https://www.g2fame.com/3rddegreefilms/go.php?pr=8&su=2&si=537&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
},
{
channel: 'addicted2girls',
url: 'https://www.g2fame.com/addicted2girls/go.php?pr=8&su=2&si=477&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
},
{
channel: 'genderxfilms',
url: 'https://www.g2fame.com/genderxfilms/go.php?pr=8&su=2&si=397&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
},
{
channel: 'gangbangcreampie',
url: 'https://www.g2fame.com/gangbangcreampie/go.php?pr=8&su=2&si=656&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
},
{
channel: 'gloryholesecrets',
url: 'https://www.g2fame.com/gloryholesecrets/go.php?pr=8&su=2&si=655&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
},
{
channel: 'tabooheat',
url: 'https://www.g2fame.com/tabooheat/go.php?pr=8&su=2&si=552&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
},
{
channel: 'wicked',
url: 'https://www.g2fame.com/wicked/go.php?pr=8&su=2&si=371&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
},
// gamma > independent channels
{
channel: 'biphoria',
url: 'https://www.g2fame.com/biphoria/go.php?pr=8&su=2&si=418&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
},
{
channel: 'burningangel',
url: 'https://www.g2fame.com/burningangel/go.php?pr=8&su=2&si=174&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
},
{
channel: 'chaosmen',
url: 'https://www.g2fame.com/chaosmen/go.php?pr=8&su=2&si=608&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
},
{
channel: 'diabolic',
url: 'https://www.g2fame.com/diabolic/go.php?pr=8&su=2&si=523&ad=277470&pa=index&ar=&buffer=',
comment: 'per signup',
},
// kelly madison / 8k
{
network: 'kellymadison',
@@ -854,6 +945,46 @@ const affiliates = [
query: 'ref=4c331ef6',
},
},
// POV Porn Cash / HussiePass
{
network: 'hussiepass',
url: 'https://secure.hussiepass.com/track/MTk0NS4xLjUuNy4wLjAuMC4wLjA',
comment: '50% revshare',
parameters: {
// hussiepass website does not show network scenes
channelScenes: false,
},
},
{
channel: 'povpornstars',
url: 'https://join.povpornstars.com/track/MTk0NS4xLjMuNS4wLjAuMC4wLjA',
comment: '50% revshare',
},
{
channel: 'interracialpovs',
url: 'https://join.interracialpovs.com/track/MTk0NS4xLjYuOC4wLjAuMC4wLjA',
comment: '50% revshare',
},
{
channel: 'ravebunnys',
url: 'https://secure.ravebunnys.com/track/MTk0NS4xLjExLjI5LjAuMC4wLjAuMA',
comment: '50% revshare',
},
{
channel: 'hotandtatted',
url: 'https://join.hotandtatted.com/track/MTk0NS4xLjEwLjEyLjAuMC4wLjAuMA',
comment: '50% revshare',
},
{
channel: 'seehimfuck',
url: 'https://join.seehimfuck.com/track/MTk0NS4xLjcuOS4wLjAuMC4wLjA',
comment: '50% revshare',
},
{
channel: 'seehimsolo',
url: 'https://join.seehimsolo.com/track/MTk0NS4xLjguMTAuMC4wLjAuMC4w',
comment: '50% revshare',
},
// etc
{
network: 'bang',

View File

@@ -351,6 +351,7 @@ function curateProfileEntry(profile) {
tattoos: profile.tattoos,
blood_type: profile.bloodType,
avatar_media_id: profile.avatarMediaId || null,
updated_at: knex.raw('DEFAULT'), // default should be NOW(), this will update the column
};
return curatedProfileEntry;

View File

@@ -3,7 +3,7 @@
const config = require('config');
const knex = require('knex');
module.exports = knex({
const knexInstance = knex({
client: 'pg',
connection: config.database.owner,
pool: config.database.pool,
@@ -11,3 +11,23 @@ module.exports = knex({
asyncStackTraces: process.env.NODE_ENV === 'development',
// debug: process.env.NODE_ENV === 'development',
});
knexInstance.on('query', function onQuery(query) {
const bindingCount = query.bindings?.length ?? 0;
if (bindingCount > 10000) {
const error = new Error(`[knex] Dangerous query: ${bindingCount} bindings detected: ${query.sql?.slice(0, 200)}${query.sql?.length > 200 ? '...' : ''}`);
Error.captureStackTrace(error, onQuery);
// console.error(error);
throw error; // optionally hard-fail so you get a real stack trace
}
});
knexInstance.on('query-error', (error, query) => {
error.knexSql = `${query.sql?.slice(0, 200)}${query.sql?.length > 200 ? '...' : ''}`;
error.knexBindingCount = query.bindings?.length;
});
module.exports = knexInstance;

View File

@@ -647,6 +647,7 @@ async function fetchHttpSource(source, tempFileTarget, hashStream) {
const res = await http.get(source.src, {
limits: 'media',
headers: {
host: new URL(source.src).hostname,
...(source.referer && { referer: source.referer }),
...(source.host && { host: source.host }),
},

View File

@@ -5,7 +5,7 @@ const angelogodshackoriginal = require('./angelogodshackoriginal');
// const americanpornstar = require('./americanpornstar'); // offline
const aziani = require('./aziani');
const badoink = require('./badoink');
// const bamvisions = require('./bamvisions');
const bamvisions = require('./bamvisions');
const bang = require('./bang');
const bradmontana = require('./bradmontana');
const cherrypimps = require('./cherrypimps');
@@ -215,7 +215,7 @@ module.exports = {
angelogodshackoriginal,
babevr: badoink,
badoinkvr: badoink,
// bamvisions, // DNS error, site offline?
bamvisions,
bang,
meidenvanholland: bluedonkeymedia, // Vurig Vlaanderen uses same database
boobpedia,

View File

@@ -57,7 +57,7 @@ function getCovers(images, target = 'cover') {
}
function getVideos(data) {
const teaserSources = data.videos.mediabook?.files;
const teaserSources = data.videos?.mediabook?.files;
const trailerSources = data.children.find((child) => child.type === 'trailer')?.videos.full?.files;
const teaser = teaserSources && Object.values(teaserSources).map((source) => ({
@@ -84,7 +84,7 @@ function scrapeLatestX(data, site, filterChannel, options) {
release.url = `${basepath}/${data.id}/${slugify(release.title)}`; // spartanId doesn't work in URLs
release.date = new Date(data.dateReleased);
release.duration = data.videos.mediabook?.length > 1 ? data.videos.mediabook.length : null;
release.duration = data.videos?.mediabook?.length > 1 ? data.videos.mediabook.length : null;
release.actors = data.actors.map((actor) => ({ name: actor.name, gender: actor.gender }));
release.tags = data.tags.map((tag) => tag.name);
@@ -127,6 +127,10 @@ async function scrapeLatest(items, site, filterChannel, options) {
}
function scrapeRelease(data, url, channel, networkName, options) {
if (Array.isArray(data)) {
return null;
}
const release = {};
const { title, description } = data;
@@ -136,7 +140,7 @@ function scrapeRelease(data, url, channel, networkName, options) {
release.description = description;
release.date = new Date(data.dateReleased);
release.duration = data.videos.mediabook?.length > 1 ? data.videos.mediabook.length : null;
release.duration = data.videos?.mediabook?.length > 1 ? data.videos.mediabook.length : null;
release.actors = data.actors.map((actor) => ({ name: actor.name, gender: actor.gender }));
release.tags = data.tags.map((tag) => tag.name);
@@ -144,7 +148,6 @@ function scrapeRelease(data, url, channel, networkName, options) {
[release.poster, ...release.photos] = getThumbs(data).map((src) => ({
src,
referer: url,
host: 'mediavault-private-fl.project1content.com',
}));
const { teaser, trailer } = getVideos(data);
@@ -270,7 +273,7 @@ async function fetchLatest(site, page = 1, options) {
return null;
}
const { instanceToken } = options.beforeNetwork?.instanceToken
const { instanceToken } = options.beforeNetwork?.instanceToken && !(options.parameters?.native || options.parameters?.childSession || options.parameters?.parentSession === false)
? options.beforeNetwork
: await getSession(site, options.parameters, url);

View File

@@ -21,6 +21,10 @@ async function scrapeApiReleases(json, site, options) {
return acc;
}
if (options.parameters?.filterChannel && scene.mainChannel?.id !== options.parameters.filterChannel) {
return acc;
}
const release = {
entryId: scene.clip_id,
description: scene.description,
@@ -35,7 +39,8 @@ async function scrapeApiReleases(json, site, options) {
if (typeof options.parameters?.scene === 'string') {
release.url = `${options.parameters.scene}${release.path}`;
} else if (site.url && options.parameters?.scene !== false) {
release.url = `${site.url}/en/video${release.path}`;
const siteSlug = new URL(site.url).pathname.match(/\/sites\/(\w+)/)?.[1];
release.url = unprint.prefixUrl(`/en/video${siteSlug ? `/${siteSlug}` : ''}${release.path}`, site.origin);
}
release.date = unprint.extractDate(scene.release_date, 'YYYY-MM-DD');
@@ -127,7 +132,7 @@ async function fetchApiCredentials(referer, site) {
}
async function fetchLatest(site, page = 1, options, _preData, upcoming = false) {
const referer = options.parameters?.referer || `${options.parameters?.networkReferer ? site.parent.url : site.url}/en/videos`;
const referer = options.parameters?.referer || `${options.parameters?.networkReferer ? site.parent.origin : site.origin}/en/videos`;
const { apiUrl } = await fetchApiCredentials(referer, site);
const slug = options.parameters.querySlug || site.slug;
@@ -178,7 +183,7 @@ async function getFullPhotos(entryId, site, parameters) {
}
async function getThumbs(entryId, site, parameters) {
const referer = parameters?.referer || `${parameters?.networkReferer ? site.parent.url : site.url}/en/videos`;
const referer = parameters?.referer || `${parameters?.networkReferer ? site.parent.origin : site.origin}/en/videos`;
const { apiUrl } = await fetchApiCredentials(referer, site);
const res = await unprint.post(apiUrl, {
@@ -236,7 +241,7 @@ async function scrapeScene(data, site, options, movieScenes) {
release.entryId = data.clip_id || data.movie_id;
release.title = curateTitle(data.title, site);
release.duration = data.length;
release.date = (data.date && new Date(data.date * 1000)) || unprint.parseDate(data.release_date || data.last_modified, 'YYYY-MM-DD');
release.date = (data.date && new Date(data.date * 1000)) || unprint.extractDate(data.release_date || data.last_modified, 'YYYY-MM-DD');
release.director = data.directors[0]?.name || null;
release.actors = data.actors.map((actor) => ({
@@ -297,7 +302,7 @@ async function scrapeScene(data, site, options, movieScenes) {
}
async function fetchScene(url, site, baseRelease, options) {
const referer = options.parameters?.referer || `${site.parameters?.networkReferer ? site.parent.url : site.url}/en/videos`;
const referer = options.parameters?.referer || `${site.parameters?.networkReferer ? site.parent.origin : site.origin}/en/videos`;
const { apiUrl } = await fetchApiCredentials(referer, site);
const entryId = (baseRelease?.path || new URL(url).pathname).match(/\/(\d{2,})(\/|$)/)?.[1];

View File

@@ -502,6 +502,7 @@ async function fetchScene(url, channel, baseRelease, options) {
}
const res = await unprint.get(url, {
interface: 'request',
useBrowser: !!options.parameters?.useBrowser,
});

136
src/tools/gamma_banners.js Normal file
View File

@@ -0,0 +1,136 @@
'use strict';
const unprint = require('unprint');
const fs = require('fs');
const { Readable } = require('stream');
const { pipeline } = require('stream/promises');
const knex = require('../knex');
const argv = require('../argv');
const slugify = require('../utils/slugify');
const apiUrl = 'https://vjoc5ygk89-dsn.algolia.net/1/indexes/*/queries?x-algolia-agent=Algolia%20for%20JavaScript%20(3.33.0)%3B%20Browser%20(lite)%3B%20react%20(16.8.6)%3B%20react-instantsearch%20(5.7.0)%3B%20JS%20Helper%20(2.28.1)&x-algolia-application-id=VJOC5YGK89&x-algolia-api-key=c5546bdfb4d3f31daf49ed3bb1463561';
async function fetchBanners() {
const res = await unprint.post(
apiUrl,
{
requests: [
{
indexName: 'creatives',
params: new URLSearchParams({
hitsPerPage: 1000,
maxValuesPerFacet: 100,
page: 0,
filters: '(ProgramType:Legacy OR ProgramType:Internal) AND NOT OverlayActive:false',
facets: '["SceneActors","SceneCategories","ProgramName","Size","Niche","MediaExt","SiteTag","OverlayName"]',
facetFilters: `[["SiteTag:${argv.site}"],["MediaExt:jpg", "MediaExt:png", "MediaExt:gif"]]`,
}).toString(),
},
],
},
{
headers: {
'content-type': 'application/x-www-form-urlencoded',
referer: 'https://creatives.gammae.com/',
},
},
);
if (res.ok && res.data.results[0]) {
return res.data.results[0].hits;
}
console.error(`Failed API request (${res.status}): ${res.body}`);
return null;
}
async function matchTags(rawTags) {
if (!rawTags) {
return [];
}
const tags = rawTags
.map((tag) => tag?.trim().match(/[a-z0-9()]+/ig)?.join(' ').toLowerCase())
.filter(Boolean);
const tagEntries = await knex('tags')
.select('tags.slug', 'aliases.slug as alias_slug')
.whereIn(knex.raw('lower(tags.name)'), tags)
.leftJoin('tags as aliases', 'aliases.id', 'tags.alias_for')
.orderByRaw('CASE WHEN tags.alias_for IS NOT NULL THEN aliases.priority ELSE tags.priority END DESC');
return tagEntries.map((tagEntry) => tagEntry.alias_slug || tagEntry.slug);
}
async function init() {
const banners = await fetchBanners();
if (!banners) {
return;
}
await banners.reduce(async (chain, banner) => {
await chain;
const channel = slugify(banner.SiteTag, '');
const url = unprint.prefixUrl(banner.MediaLocation || banner.CreativeURL, 'https://cdn.banhq.com');
if (!url) {
console.log('No URL found');
console.log(banner);
return;
}
const tags = await matchTags([
...banner.Tags?.map((tag) => tag.Value) || [],
...banner.SceneCategories || [],
banner.Niche,
].filter(Boolean));
const fileTags = tags.slice(0, 4).join('_');
const fileActors = banner.SceneActors?.slice(0, 2).map((actor) => slugify(actor, '_')).join('_');
// tags are unreliable and describe entire scene, not banner, don't include by default
const segments = [channel, banner.Width, banner.Height, banner.MediaID, argv.actors?.[0] !== false && fileActors].filter(Boolean);
const filename = `${segments.join('_')}${argv.tags && argv.tags ? `-${fileTags}` : ''}.${banner.MediaExt || 'jpg'}`;
const filepath = `/tmp/gamma/${channel}/${filename}`;
if (argv.inspect) {
console.log(banner);
}
if (argv.preview) {
console.log(`Preview ${url}: ${filepath}`);
return;
}
await fs.promises.mkdir(`/tmp/gamma/${channel}`, { recursive: true });
try {
const res = await fetch(url);
if (res.ok && res.body) {
const writer = fs.createWriteStream(filepath);
await pipeline(Readable.fromWeb(res.body), writer);
if (argv.actors) {
console.log(`Saved ${url} to ${filepath}`);
} else {
console.log(`Saved ${url} to ${filepath}, actors ${banner.SceneActors?.join(', ') || ''}`);
}
} else {
console.log(`Failed to fetch ${url} (${res.status})`);
}
} catch (error) {
console.log(`Failed to fetch ${url}: ${error.message}`);
}
}, Promise.resolve());
await knex.destroy();
}
init();

15
src/tools/huge-query.js Normal file
View File

@@ -0,0 +1,15 @@
'use strict';
const knex = require('../knex');
async function init() {
const data = Array.from({ length: 100_000 }, (value, index) => ({
id: `test_affiliate_${index}`,
}));
await knex('affiliates').insert(data);
console.log('Done!');
}
init();

View File

@@ -41,7 +41,7 @@ async function fetchScenes() {
studios.name as studio_name,
grandparents.id as parent_network_id,
COALESCE(JSON_AGG(DISTINCT (actors.id, actors.name)) FILTER (WHERE actors.id IS NOT NULL), '[]') as actors,
COALESCE(JSON_AGG(DISTINCT (tags.id, tags.name, tags.priority, tags_aliases.name)) FILTER (WHERE tags.id IS NOT NULL), '[]') as tags,
COALESCE(JSON_AGG(DISTINCT (tags.id, tags.name, tags.priority, tags_aliases.name, local_tags.actor_id)) FILTER (WHERE tags.id IS NOT NULL), '[]') as tags,
COALESCE(JSON_AGG(DISTINCT (movies.id, movies.title)) FILTER (WHERE movies.id IS NOT NULL), '[]') as movies,
COALESCE(JSON_AGG(DISTINCT (series.id, series.title)) FILTER (WHERE series.id IS NOT NULL), '[]') as series,
COALESCE(JSON_AGG(DISTINCT (releases_fingerprints.hash)) FILTER (WHERE releases_fingerprints.hash IS NOT NULL), '[]') as fingerprints,
@@ -136,6 +136,14 @@ async function init() {
dupe_index int
)`);
await utilsApi.sql('drop table if exists scenes_tags');
await utilsApi.sql(`create table scenes_tags (
id int,
scene_id int,
tag_id int,
actor_id int
)`);
console.log('Recreated scenes table');
console.log('Fetching scenes from primary database');
@@ -143,49 +151,62 @@ async function init() {
console.log('Fetched scenes from primary database');
const docs = scenes.map((scene) => {
const docs = scenes.flatMap((scene) => {
const flatActors = scene.actors.flatMap((actor) => actor.f2.match(/[\w']+/g)); // match word characters to filter out brackets etc.
const flatTags = scene.tags.filter((tag) => tag.f3 > 6).flatMap((tag) => (tag.f4 ? `${tag.f2} ${tag.f4}` : tag.f2).match(/[\w']+/g)); // only make top tags searchable to minimize cluttered results
const filteredTitle = filterTitle(scene.title, [...flatActors, ...flatTags]);
return {
replace: {
index: 'scenes',
id: scene.id,
doc: {
title: scene.title || undefined,
title_filtered: filteredTitle || undefined,
date: scene.date ? Math.round(scene.date.getTime() / 1000) : undefined,
created_at: Math.round(scene.created_at.getTime() / 1000),
effective_date: Math.round((scene.date || scene.created_at).getTime() / 1000),
is_showcased: scene.showcased,
entry_id: scene.entry_id || undefined,
shoot_id: scene.shoot_id || undefined,
channel_id: scene.channel_id,
channel_slug: scene.channel_slug,
channel_name: [].concat(scene.channel_name, scene.channel_aliases).join(' '),
network_id: scene.network_id || undefined,
network_slug: scene.network_slug || undefined,
network_name: [].concat(scene.network_name, scene.network_aliases).join(' ') || undefined,
studio_id: scene.studio_id || undefined,
studio_slug: scene.studio_slug || undefined,
studio_name: scene.studio_name || undefined,
entity_ids: [scene.channel_id, scene.network_id, scene.parent_network_id, scene.studio_id].filter(Boolean), // manticore does not support OR, this allows IN
actor_ids: scene.actors.map((actor) => actor.f1),
actors: scene.actors.map((actor) => actor.f2).join(),
tag_ids: scene.tags.map((tag) => tag.f1),
tags: flatTags.join(' '),
movie_ids: scene.movies.map((movie) => movie.f1),
movies: scene.movies.map((movie) => movie.f2).join(' '),
serie_ids: scene.series.map((serie) => serie.f1),
series: scene.series.map((serie) => serie.f2).join(' '),
fingerprints: scene.fingerprints.join(' '),
meta: scene.date ? format(scene.date, 'y yy M MM MMM MMMM d dd') : undefined,
stashed: scene.stashed || 0,
dupe_index: scene.dupe_index || 0,
return [
{
replace: {
index: 'scenes',
id: scene.id,
doc: {
title: scene.title || undefined,
title_filtered: filteredTitle || undefined,
date: scene.date ? Math.round(scene.date.getTime() / 1000) : undefined,
created_at: Math.round(scene.created_at.getTime() / 1000),
effective_date: Math.round((scene.date || scene.created_at).getTime() / 1000),
is_showcased: scene.showcased,
entry_id: scene.entry_id || undefined,
shoot_id: scene.shoot_id || undefined,
channel_id: scene.channel_id,
channel_slug: scene.channel_slug,
channel_name: [].concat(scene.channel_name, scene.channel_aliases).join(' '),
network_id: scene.network_id || undefined,
network_slug: scene.network_slug || undefined,
network_name: [].concat(scene.network_name, scene.network_aliases).join(' ') || undefined,
studio_id: scene.studio_id || undefined,
studio_slug: scene.studio_slug || undefined,
studio_name: scene.studio_name || undefined,
entity_ids: [scene.channel_id, scene.network_id, scene.parent_network_id, scene.studio_id].filter(Boolean), // manticore does not support OR, this allows IN
actor_ids: scene.actors.map((actor) => actor.f1),
actors: scene.actors.map((actor) => actor.f2).join(),
tag_ids: scene.tags.map((tag) => tag.f1),
tags: flatTags.join(' '),
movie_ids: scene.movies.map((movie) => movie.f1),
movies: scene.movies.map((movie) => movie.f2).join(' '),
serie_ids: scene.series.map((serie) => serie.f1),
series: scene.series.map((serie) => serie.f2).join(' '),
fingerprints: scene.fingerprints.join(' '),
meta: scene.date ? format(scene.date, 'y yy M MM MMM MMMM d dd') : undefined,
stashed: scene.stashed || 0,
dupe_index: scene.dupe_index || 0,
},
},
},
};
...scene.tags.map((tag) => ({
replace: {
index: 'scenes_tags',
// id: scene.id,
doc: {
scene_id: scene.id,
tag_id: tag.f1,
actor_id: tag.f5,
},
},
})),
];
});
// const accData = chunk(docs, 10000).reduce(async (chain, docsChunk, index, array) => {

View File

@@ -0,0 +1,88 @@
'use strict';
const config = require('config');
const manticore = require('manticoresearch');
const knex = require('../knex');
const chunk = require('../utils/chunk');
const mantiClient = new manticore.ApiClient();
mantiClient.basePath = `http://${config.database.manticore.host}:${config.database.manticore.httpPort}`;
const utilsApi = new manticore.UtilsApi(mantiClient);
const indexApi = new manticore.IndexApi(mantiClient);
async function syncStashes(domain = 'scene') {
await utilsApi.sql(`truncate table ${domain}s_stashed`);
const stashes = await knex(`stashes_${domain}s`)
.select(
`stashes_${domain}s.id as stashed_id`,
`stashes_${domain}s.${domain}_id`,
'stashes.id as stash_id',
'stashes.user_id as user_id',
`stashes_${domain}s.created_at as created_at`,
)
.leftJoin('stashes', 'stashes.id', `stashes_${domain}s.stash_id`);
await chunk(stashes, 1000).reduce(async (chain, stashChunk, index) => {
await chain;
const stashDocs = stashChunk.map((stash) => ({
replace: {
index: `${domain}s_stashed`,
id: stash.stashed_id,
doc: {
[`${domain}_id`]: stash[`${domain}_id`],
stash_id: stash.stash_id,
user_id: stash.user_id,
created_at: Math.round(stash.created_at.getTime() / 1000),
},
},
}));
await indexApi.bulk(stashDocs.map((doc) => JSON.stringify(doc)).join('\n'));
console.log(`Synced ${index * 1000 + stashChunk.length}/${stashes.length} ${domain} stashes`);
}, Promise.resolve());
}
async function init() {
await utilsApi.sql('drop table if exists scenes_stashed');
await utilsApi.sql(`create table if not exists scenes_stashed (
scene_id int,
stash_id int,
user_id int,
created_at timestamp
)`);
await utilsApi.sql('drop table if exists movies_stashed');
await utilsApi.sql(`create table if not exists movies_stashed (
movie_id int,
stash_id int,
user_id int,
created_at timestamp
)`);
await utilsApi.sql('drop table if exists actors_stashed');
await utilsApi.sql(`create table if not exists actors_stashed (
actor_id int,
stash_id int,
user_id int,
created_at timestamp
)`);
await syncStashes('scene');
await syncStashes('actor');
await syncStashes('movie');
console.log('Done!');
knex.destroy();
}
init();

View File

@@ -16,14 +16,14 @@ async function updateManticoreStashedScenes(docs) {
await chunk(docs, 1000).reduce(async (chain, docsChunk) => {
await chain;
const sceneIds = docsChunk.map((doc) => doc.replace.id);
const sceneIds = docsChunk.filter((doc) => !!doc.replace).map((doc) => doc.replace.id);
const stashes = await knex('stashes_scenes')
.select('stashes_scenes.id as stashed_id', 'stashes_scenes.scene_id', 'stashes_scenes.created_at', 'stashes.id as stash_id', 'stashes.user_id as user_id')
.leftJoin('stashes', 'stashes.id', 'stashes_scenes.stash_id')
.whereIn('scene_id', sceneIds);
const stashDocs = docsChunk.flatMap((doc) => {
const stashDocs = docsChunk.filter((doc) => doc.replace).flatMap((doc) => {
const sceneStashes = stashes.filter((stash) => stash.scene_id === doc.replace.id);
if (sceneStashes.length === 0) {
@@ -50,6 +50,25 @@ async function updateManticoreStashedScenes(docs) {
if (stashDocs.length > 0) {
await indexApi.bulk(stashDocs.map((doc) => JSON.stringify(doc)).join('\n'));
}
const deleteSceneIds = docs.filter((doc) => doc.delete).map((doc) => doc.delete.id);
if (deleteSceneIds.length > 0) {
await indexApi.callDelete({
index: 'scenes_stashed',
query: {
bool: {
must: [
{
in: {
scene_id: deleteSceneIds,
},
},
],
},
},
});
}
}, Promise.resolve());
}
@@ -128,9 +147,20 @@ async function updateManticoreSceneSearch(releaseIds) {
studios.showcased
`, releaseIds && [releaseIds]);
// console.log(scenes.rows);
const scenesById = Object.fromEntries(scenes.rows.map((scene) => [scene.id, scene]));
const docs = releaseIds.map((sceneId) => {
const scene = scenesById[sceneId];
if (!scene) {
return {
delete: {
index: 'scenes',
id: sceneId,
},
};
}
const docs = scenes.rows.map((scene) => {
const flatActors = scene.actors.flatMap((actor) => actor.f2.split(' '));
const flatTags = scene.tags.filter((tag) => tag.f3 > 6).flatMap((tag) => [tag.f2].concat(tag.f4)).filter(Boolean); // only make top tags searchable to minimize cluttered results
const filteredTitle = filterTitle(scene.title, [...flatActors, ...flatTags]);
@@ -291,7 +321,20 @@ async function updateManticoreMovieSearch(movieIds) {
movies_covers.*
`, movieIds && [movieIds]);
const docs = movies.rows.map((movie) => {
const moviesById = Object.fromEntries(movies.rows.map((movie) => [movie.id, movie]));
const docs = movieIds.map((movieId) => {
const movie = moviesById[movieId];
if (!movie) {
return {
delete: {
index: 'movies',
id: movieId,
},
};
}
const combinedTags = Object.values(Object.fromEntries(movie.tags.concat(movie.movie_tags).map((tag) => [tag.f1, {
id: tag.f1,
name: tag.f2,

View File

@@ -145,7 +145,7 @@ const actors = [
// perv city
{ entity: 'pervcity', name: 'Brooklyn Gray', fields: ['avatar', 'description', 'dateOfBirth', 'birthPlace', 'ethnicity', 'height', 'weight', 'eyes', 'hairColor'] },
{ entity: 'dpdiva', name: 'Liz Jordan', fields: ['avatar', 'description', 'dateOfBirth', 'birthPlace', 'ethnicity', 'height', 'weight', 'eyes', 'hairColor'] },
// { entity: 'bamvisions', name: 'Abella Danger', fields: ['avatar', 'height', 'measurements'] }, // site offline as of 2026-02-25
{ entity: 'bamvisions', name: 'Abella Danger', fields: ['avatar', 'height', 'measurements'] }, // site offline as of 2026-02-25
// radical
{ entity: 'bjraw', name: 'Nikki Knightly', fields: ['avatar', 'description', 'gender', 'dateOfBirth', 'birthPlace', 'measurements', 'height', 'weight', 'eyes', 'hairColor'] },
{ entity: 'gotfilled', name: 'Alexa Chains', fields: ['avatar', 'description', 'gender', 'dateOfBirth', 'birthPlace', 'measurements', 'height', 'weight', 'eyes', 'hairColor'] },