Added virtual entity spawning for multi-page updates (i.e. Elegant Angel). Fixed ffmpeg error freezing process. Refactored Adult Empire/Elegant Angel scraper.

This commit is contained in:
DebaucheryLibrarian
2024-08-16 23:26:52 +02:00
parent 958c6d83fa
commit bca677b0a8
16 changed files with 287 additions and 249 deletions

View File

@@ -3270,6 +3270,15 @@ const sites = [
slug: 'elegantangel',
name: 'Elegant Angel',
url: 'https://www.elegantangel.com',
options: {
spawn: [
{
parameters: {
latest: 'https://www.elegantangel.com/watch-exclusive-elegant-angel-scenes.html',
},
},
],
},
},
// EVIL ANGEL
{
@@ -13478,7 +13487,6 @@ const sites = [
tags: ['black-cock'],
parameters: {
studio: false,
layout: 'grid',
},
},
// WHALE MEMBER
@@ -13713,27 +13721,36 @@ exports.seed = (knex) => Promise.resolve()
.then(async () => {
await Promise.all(sites.map(async (channel) => {
if (channel.rename) {
return knex('entities')
await knex('entities')
.where({
type: channel.type || 'channel',
slug: channel.rename,
})
.update('slug', channel.slug);
return;
}
return null;
if (channel.delete) {
await knex('entities')
.where({
type: channel.type || 'channel',
slug: channel.slug,
})
.delete();
}
}).filter(Boolean));
const networks = await knex('entities')
.where('type', 'network')
.orWhereNull('parent_id');
const networksMap = networks.reduce((acc, { id, slug }) => ({ ...acc, [slug]: id }), {});
const networksMap = networks.filter((network) => !network.delete).reduce((acc, { id, slug }) => ({ ...acc, [slug]: id }), {});
const tags = await knex('tags').select('*').whereNull('alias_for');
const tagsMap = tags.reduce((acc, { id, slug }) => ({ ...acc, [slug]: id }), {});
const sitesWithNetworks = sites.map((site) => ({
const sitesWithNetworks = sites.filter((site) => !site.delete).map((site) => ({
slug: site.slug,
name: site.name,
type: site.type || 'channel',
@@ -13741,6 +13758,7 @@ exports.seed = (knex) => Promise.resolve()
description: site.description,
url: site.url,
parameters: site.parameters,
options: site.options,
parent_id: networksMap[site.parent],
priority: site.priority || 0,
independent: !!site.independent,