Refactored various modules for entities. Updated and refactored Kink scraper.
This commit is contained in:
@@ -21,6 +21,10 @@ const parentNetworks = [
|
||||
slug: 'whalemember',
|
||||
name: 'Whale Member',
|
||||
},
|
||||
{
|
||||
slug: 'wgcz',
|
||||
name: 'WGCZ Holding',
|
||||
},
|
||||
];
|
||||
|
||||
const networks = [
|
||||
@@ -98,6 +102,7 @@ const networks = [
|
||||
name: 'Bang Bros',
|
||||
url: 'https://bangbros.com',
|
||||
description: 'Here at Bang Bros, we only film the best highest quality porn with the sexiest Amateur girls and the top pornstars. Updated daily on Bangbros.com.',
|
||||
parent: 'wgcz',
|
||||
},
|
||||
{
|
||||
slug: 'blowpass',
|
||||
@@ -120,7 +125,7 @@ const networks = [
|
||||
slug: 'boobpedia',
|
||||
name: 'Boobpedia',
|
||||
url: 'https://www.boobpedia.com',
|
||||
type: 4,
|
||||
type: 'info',
|
||||
},
|
||||
{
|
||||
slug: 'burningangel',
|
||||
@@ -142,13 +147,14 @@ const networks = [
|
||||
slug: 'freeones',
|
||||
name: 'FreeOnes',
|
||||
url: 'https://www.freeones.com',
|
||||
type: 4,
|
||||
type: 'info',
|
||||
},
|
||||
{
|
||||
slug: 'ddfnetwork',
|
||||
name: 'DDF Network',
|
||||
url: 'https://ddfnetwork.com',
|
||||
description: 'European porn videos hub with exclusive VR, 4K and full HD XXX videos and hot sex photos of Europes finest porn star babes.',
|
||||
parent: 'wgcz',
|
||||
},
|
||||
{
|
||||
slug: 'digitalplayground',
|
||||
@@ -272,6 +278,7 @@ const networks = [
|
||||
name: 'LegalPorno',
|
||||
url: 'https://www.legalporno.com',
|
||||
description: 'The Best HD Porn For You!',
|
||||
parent: 'wgcz',
|
||||
},
|
||||
{
|
||||
slug: 'men',
|
||||
@@ -355,6 +362,7 @@ const networks = [
|
||||
name: 'Private',
|
||||
url: 'https://www.private.com',
|
||||
description: 'Private is the best source for adult movies and videos. Featuring the most popular hardcore adult stars in hundreds of porn movies, Private.com delivers...',
|
||||
parent: 'wgcz',
|
||||
},
|
||||
{
|
||||
slug: 'puretaboo',
|
||||
@@ -437,13 +445,13 @@ const networks = [
|
||||
|
||||
exports.seed = knex => Promise.resolve()
|
||||
.then(async () => {
|
||||
const { inserted, updated } = await upsert('entities', parentNetworks.map(network => ({ ...network, type: 1 })), ['slug', 'type'], knex);
|
||||
const { inserted, updated } = await upsert('entities', parentNetworks.map(network => ({ ...network, type: 'network' })), ['slug', 'type'], knex);
|
||||
const parentNetworksBySlug = [].concat(inserted, updated).reduce((acc, network) => ({ ...acc, [network.slug]: network.id }), {});
|
||||
|
||||
const networksWithParent = networks.map(network => ({
|
||||
slug: network.slug,
|
||||
name: network.name,
|
||||
type: network.type || 1,
|
||||
type: network.type || 'network',
|
||||
alias: network.alias ? network.alias.join(',') : null,
|
||||
url: network.url,
|
||||
description: network.description,
|
||||
|
||||
@@ -2830,6 +2830,13 @@ const sites = [
|
||||
description: 'Learn BDSM Technical Skills & Theories From Respected Teachers In The Kink Community. Learn BDSM skills and improve your sex techniques. Video tutorials feature top sex ed experts and hardcore demos on topics from bondage to relationships.',
|
||||
network: 'kink',
|
||||
},
|
||||
{
|
||||
slug: 'kinkybites',
|
||||
name: 'Kinky Bites',
|
||||
url: 'https://www.kink.com/channel/kinkybites',
|
||||
description: 'Come see what the hottest kink models have for you at home. Sink your teeth into this kinky private collection made just for you.',
|
||||
network: 'kink',
|
||||
},
|
||||
{
|
||||
slug: 'meninpain',
|
||||
name: 'Men In Pain',
|
||||
@@ -6369,7 +6376,7 @@ exports.seed = knex => Promise.resolve()
|
||||
const sitesWithNetworks = sites.map(site => ({
|
||||
slug: site.slug,
|
||||
name: site.name,
|
||||
type: site.type || 2,
|
||||
type: site.type || 'channel',
|
||||
alias: (site.alias || []).join(','),
|
||||
description: site.description,
|
||||
url: site.url,
|
||||
|
||||
@@ -153,17 +153,13 @@ function getStudios(networksMap) {
|
||||
/* eslint-disable max-len */
|
||||
exports.seed = knex => Promise.resolve()
|
||||
.then(async () => {
|
||||
const [networks, types] = await Promise.all([
|
||||
knex('entities').select('*'),
|
||||
knex('entities_types').select('*'),
|
||||
]);
|
||||
const networks = await knex('entities').select('*').where('type', 'network');
|
||||
|
||||
const networksMap = networks.reduce((acc, { id, slug }) => ({ ...acc, [slug]: id }), {});
|
||||
const typesMap = types.reduce((acc, type) => ({ [type.type]: type.id }), {});
|
||||
|
||||
const studios = getStudios(networksMap).map(studio => ({
|
||||
...studio,
|
||||
type: typesMap.studio,
|
||||
type: 'studio',
|
||||
}));
|
||||
|
||||
return upsert('entities', studios, 'slug', knex);
|
||||
|
||||
Reference in New Issue
Block a user