/* eslint-disable max-len */ const omit = require('object.omit'); const upsert = require('../src/utils/upsert'); const grandParentNetworks = [ { slug: 'gamma', name: 'Gamma Entertainment', url: 'https://www.gammaentertainment.com', alias: ['gammaentertainment'], }, { slug: 'hush', name: 'Hush', }, { slug: 'aylo', name: 'Aylo', rename: 'mindgeek', alias: ['mindgeek', 'mind geek'], url: 'https://www.aylo.com', description: '', parameters: { interval: 1000, concurrency: 1, }, }, { slug: 'whalemember', name: 'Whale Member', }, { slug: 'paperstreetmedia', name: 'Paper Street Media', }, { slug: 'porndoe', name: 'PornDoe', }, { slug: 'wgcz', name: 'WGCZ Holding', }, ]; const parentNetworks = [ { slug: '21sextury', name: '21Sextury', url: 'https://www.21sextury.com', description: 'Watch all the latest scenes and porn video updates on 21Sextury.com, the best European porn site with the hottest pornstars from all over the world! Watch porn videos from the large network here.', parameters: { layout: 'api', mobile: 'https://m.dpfanatics.com/en/video', }, parent: 'gamma', }, { slug: 'radical', alias: ['kb productions'], name: 'Radical Entertainment', url: 'https://radicalcash.com', }, { slug: 'kink', name: 'Kink', url: 'https://www.kink.com', description: 'Authentic Bondage & Real BDSM Porn Videos. Demystifying and celebrating alternative sexuality by providing the most authentic kinky videos. Experience the other side of porn.', parameters: { interval: 1000, concurrency: 1, }, }, { slug: 'dfxtra', name: 'DFXtra', alias: ['dfextra'], url: 'https://dfxtra.com', parent: 'gamma', }, ]; const networks = [ { slug: '21sextreme', name: '21Sextreme', url: 'https://www.21sextreme.com', description: 'Welcome to 21Sextreme.com, your portal to fisting porn, old and young lesbians, horny grannies & extreme BDSM featuring the best Euro & American Pornstars', parameters: { layout: 'api', mobile: 'https://m.dpfanatics.com/en/video', }, parent: '21sextury', }, { slug: '21naturals', name: '21Naturals', url: 'https://www.21naturals.com', description: 'Welcome to 21Naturals.com, the porn network featuring the hottest pornstars from all over the world in all natural porn and erotic sex videos. Watch thousands of girls with natural tits', parameters: { layout: 'api', mobile: 'https://m.dpfanatics.com/en/video', }, parent: '21sextury', }, { slug: 'adultempire', name: 'Adult Empire', url: 'https://www.adultempire.com', type: 'info', }, { slug: 'adulttime', name: 'Adult Time', url: 'https://www.adulttime.com', description: 'Adult Time is a premium streaming service for adults! Watch adult movies, series, and channels from the top names in the industry.', parent: 'gamma', parameters: { layout: 'api', referer: 'https://freetour.adulttime.com/en/join', scene: false, }, }, { slug: 'amateurallure', name: 'Amateur Allure', url: 'https://www.amateurallure.com', }, { slug: 'amateureuro', name: 'Amateur Euro', url: 'https://amateureuro.com', parent: 'porndoe', }, { slug: 'amnesiac', name: 'Amnesiac', hasLogo: true, }, { slug: 'analvids', name: 'AnalVids', alias: ['legalporno', 'clip', 'gonzo'], url: 'https://www.analvids.com', parent: 'wgcz', }, { slug: 'assylum', name: 'Assylum', url: 'https://www.assylum.com', description: 'At Assylum, submissive girls get dominated with rough anal sex, ass to mouth, hard BDSM, and sexual humiliation and degradation.', }, { slug: 'aziani', name: 'Aziani', parent: 'gamma', url: 'https://www.aziani.com', parameters: { layout: 'api', }, }, { slug: 'babes', name: 'Babes', url: 'https://www.babes.com', parent: 'aylo', }, { slug: 'badoink', name: 'BaDoink', url: 'http://www.badoink.com', }, { slug: 'bang', name: 'Bang!', url: 'https://bang.com', }, { slug: 'bangbros', 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', parameters: { preferSpartanId: true, }, }, { slug: 'blowpass', name: 'Blowpass', alias: ['myxxxpass'], url: 'https://www.blowpass.com', description: 'Welcome to Blowpass.com, your ultimate source for deepthroat porn, MILF and teen blowjob videos, big cumshots and any and everything oral!', parameters: { layout: 'api', referer: 'https://www.blowpass.com', }, parent: 'gamma', }, { slug: 'bluedonkeymedia', name: 'Blue Donkey Media', url: 'https://bluedonkeymedia.nl', }, { slug: 'brazzers', name: 'Brazzers', url: 'https://www.brazzers.com', description: 'Brazzers homepage is updated daily with official HD porn scenes. Our hottest videos and sex series are filled with big tits, sexy milf, top pornstars and special events.', parent: 'aylo', parameters: { childSession: true, }, }, { slug: 'boobpedia', name: 'Boobpedia', url: 'https://www.boobpedia.com', type: 'info', }, { slug: 'cherrypimps', name: 'Cherry Pimps', url: 'https://www.cherrypimps.com', description: 'CherryPimps your premium porn site to Download and Stream the hottest and most exclusive 4K HD videos and pictures on your phone, tablet, TV or console.', }, { slug: 'cumlouder', name: 'Cum Louder', url: 'https://www.cumlouder.com', }, { slug: 'czechav', name: 'CzechAV', url: 'https://www.czechav.com', }, { slug: 'dorcel', name: 'Marc Dorcel', url: 'https://www.dorcel.com', }, { slug: 'evilangel', name: 'Evil Angel', url: 'https://www.evilangel.com', description: 'Welcome to the award winning Evil Angel website, home to the most popular pornstars of today, yesterday and tomorrow in their most extreme and hardcore porn scenes to date. We feature almost 30 years of rough sex videos and hardcore anal porn like you\'ve never seen before, and have won countless AVN and XBiz awards including \'Best Site\' and \'Best Studio\'.', parent: 'gamma', parameters: { layout: 'api', }, }, { slug: 'exploitedx', name: 'ExpoitedX', parameters: { layout: 'tubular', }, }, { slug: 'freeones', name: 'FreeOnes', url: 'https://www.freeones.com', type: 'info', }, { slug: 'pornworld', name: 'Porn World', alias: [ 'ddf network', 'denys defrancesco', ], url: 'https://pornworld.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', name: 'Digital Playground', url: 'https://www.digitalplayground.com', description: 'DigitalPlayground.com is the leader in high quality adult blockbuster movies and award winning sex parodies that feature the most exclusive pornstars online! Adult Film Database of adult movies.', parameters: { actorPath: 'modelprofile', forceDeep: true, // Digital Playground has movie and series information not available in the latest updates API }, parent: 'aylo', }, { slug: 'dogfartnetwork', name: 'Dogfart Network', url: 'https://dogfartnetwork.com', description: 'The world famous Dogfart Interracial series. Online since 1996, we have the largest collection of Interracial videos, pictures and content on the web.', parent: 'dfxtra', parameters: { layout: 'api', }, }, { slug: 'fabulouscash', name: 'Fabulous Cash', hasLogo: false, url: 'https://fabulouscash.com', }, { slug: 'fantasymassage', name: 'Fantasy Massage', url: 'https://www.fantasymassage.com', parameters: { layout: 'api', }, parent: 'gamma', }, { slug: 'famedigital', name: 'Fame Digital', url: 'https://www.famedigital.com', description: 'Watch and download thousands of the best porn videos at FameDigital.com, the largest porn network on the web! The hottest teens, MILFs and more pornstars are all here!', parameters: { mobile: 'https://m.dpfanatics.com/en/video', }, parent: 'gamma', }, { slug: 'fakehub', name: 'Fake Hub', url: 'https://www.fakehub.com', description: 'Wherever they go, there is porn. Hospital, Taxis, Casting… Maybe fucking to a fake cop, fake agent or fake taxi driver. And we record it all.', parameters: { actorPath: 'modelprofile', }, parent: 'aylo', }, { slug: 'filthykings', name: 'Filthy Kings', url: 'https://www.filthykings.com', parent: 'gamma', parameters: { layout: 'api', queryChannel: true, scene: 'https://www.filthykings.com/en/video/filthykings', referer: 'https://www.filthykings.com', album: 'https://www.filthykings.com', }, }, { slug: 'firstanalquest', name: 'First Anal Quest', url: 'http://www.firstanalquest.com', }, { slug: 'theflourish', name: 'The Flourish', url: 'https://theflourish.io', }, { slug: 'forbondage', name: 'ForBondage', url: 'https://forbondage.com', parent: 'porndoe', }, { slug: 'fullpornnetwork', name: 'Full Porn Network', url: 'https://www.fullpornnetwork.com', description: 'FullPornNetwork.com is the latest and greatest for one stop shop porn sites. Check out the expanding library of the multi-site network. All of fan\'s favorite content from ANALIZED.COM, DTFsluts.com, YourMomDoesPorn.com and many more. Give die hard porn fans access to an array of premium content available in 4k and 1080p. Full access included streaming hd and unlimited downloads. Be exclusive, be a member to FullPornNetwork.com Today.', }, { slug: 'gaywire', name: 'Gaywire', url: 'https://gaywire.com', tags: ['gay'], }, { slug: 'girlsway', name: 'Girlsway', url: 'https://www.girlsway.com', description: 'Girlsway.com has the best lesbian porn videos online! The hottest pornstars & first time lesbians in real girl on girl sex, tribbing, squirting & pussy licking action right HERE!', parameters: { layout: 'api', }, parent: 'gamma', }, { slug: 'hitzefrei', name: 'Hitzefrei', url: 'http://www.hitzefrei.com', }, { slug: 'hussiepass', name: 'Hussie Pass', url: 'https://www.hussiepass.com', parent: 'hush', }, { slug: 'hushpass', name: 'Hush Pass', url: 'https://www.hushpass.com', parent: 'hush', parameters: { t1: true, sequential: true, }, }, { slug: 'innofsin', name: 'Inn Of Sin', }, { slug: 'interracialpass', name: 'Interracial Pass', url: 'https://www.interracialpass.com', parent: 'hush', parameters: { t1: true, sequential: true, }, }, { slug: 'insex', name: 'Insex', description: 'The original bondage and BDSM transgression.', url: 'http://www.insex.com', }, { slug: 'jayrock', name: 'JayRock Productions', url: 'http://jayrockcontent.com', parent: 'gamma', }, { slug: 'julesjordan', name: 'Jules Jordan', url: 'https://www.julesjordan.com', }, { slug: 'karups', name: 'Karups', url: 'https://www.karups.com', }, { slug: 'kellymadison', name: 'Kelly Madison Media', url: 'https://www.kellymadison.com', description: 'Home of Kelly Madison and Ryan Madison', }, { slug: 'killergram', name: 'Killergram', url: 'http://www.killergram.com', }, { slug: 'kinkmen', name: 'Kink Men', url: 'https://www.kinkmen.com', parent: 'kink', tags: ['gay'], parameters: { interval: 1000, concurrency: 1, }, }, { slug: 'letsdoeit', name: 'LetsDoeIt', url: 'https://letsdoeit.com', parent: 'porndoe', }, { slug: 'littlecapricedreams', name: 'Little Caprice Dreams', url: 'https://www.littlecaprice-dreams.com', }, { slug: 'loveherfilms', name: 'Love Her Films', url: 'https://www.loveherfilms.com', }, { slug: 'mamacitaz', name: 'Mamacitaz', url: 'https://mamacitaz.com', parent: 'porndoe', }, { slug: 'men', name: 'Men', url: 'https://www.men.com', description: 'Check out the best gay porn site on the net with daily updates, award-winning original series, exclusive Men.com models and over 800 of the hottest guys in gay porn.', parameters: { actorPath: 'modelprofile', }, parent: 'aylo', }, { slug: 'metrohd', name: 'Metro HD', url: 'https://www.metrohd.com', description: 'Checkout MetroHD official pornsite featuring top rated pornstars and XXX videos.', parent: 'aylo', parameters: { parentSession: false, }, }, { slug: 'mikeadriano', name: 'Mike Adriano', url: 'https://www.mikeadriano.com', }, { slug: 'milehighmedia', name: 'Mile High Media', url: 'https://www.milehighmedia.com', description: 'MileHighMedia.com is the only niche porn network you need! Watch lesbian sex, hardcore fucking and family porn stories with the hottest teens & MILFs!', parent: 'aylo', parameters: { forceDeep: true, // Mile High Media has movie and series information not available in the latest updates API parentSession: false, }, }, { slug: 'missax', name: 'MissaX', url: 'https://missax.com', }, { slug: 'modelmedia', name: 'Model Media', url: 'https://www.modelmediacash.com', }, { slug: 'mofos', name: 'MOFOS', url: 'https://www.mofos.com', description: 'Check out the Official Mofos Network of best amateur pornsites. Girlfriend – voyeur - college girls - first anal & more. Bonus Milf sites for wifey lovers.', parent: 'aylo', }, { slug: 'mylf', name: 'MYLF', tags: ['milf'], url: 'https://www.mylf.com', parent: 'paperstreetmedia', parameters: { endpoint: 'mylf-elastic-hka5k7vyuw', avatars: 'https://images.mylfcdn.net/tsv4/model/profiles', }, }, { slug: 'naughtyamerica', name: 'Naughty America', url: 'https://www.naughtyamerica.com', description: 'The best porn movies daily at Naughty America! Experience the most seductive porn stars in stunning virtual reality, 4K and HD porn videos!', }, { slug: 'nebraskacoeds', name: 'Nebraska Coeds', url: 'https://nebraskacoeds.com', showcased: false, parameters: { layout: 'classic', }, }, { slug: 'newsensations', name: 'New Sensations', url: 'https://www.newsensations.com', description: 'Home to multiple award-winning studios New Sensations & Digital Sin with over 7,000 HQ porn movies! Take the free tour now!', }, { slug: 'nubiles', name: 'Nubiles', url: 'https://www.nubiles.com', description: 'Welcome to the teen megasite that started it all! Browse our massive HD collection of fresh legal hotties at Nubiles.net.', }, { slug: 'perfectgonzo', name: 'Perfect Gonzo', url: 'https://www.perfectgonzo.com', description: '', }, { slug: 'pervcity', name: 'Perv City', url: 'https://www.pervcity.com', parameters: { networkEntryIds: true, }, }, { slug: 'pimpxxx', name: 'Pimp.XXX', url: 'https://www.pimp.xxx', description: 'PIMP.XXX is the NEWEST and HOTTEST site featuring Exclusive Ultra High Definition 4k videos updated daily! Featuring the newest and the biggest pornstars with Big Tits, Tight Asses, and more!', }, { slug: 'porncz', name: 'PornCZ', url: 'https://www.porncz.com', }, { slug: 'pornpros', name: 'Porn Pros', url: 'https://pornpros.com', description: 'Watch the best HD exclusive movies and videos on Porn Pros. All the hottest new Pornstar and amateur girls in High Definition updated daily.', parent: 'whalemember', }, { slug: 'private', 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', name: 'Pure Taboo', url: 'https://www.puretaboo.com', description: 'PureTaboo.com is the ultimate site for family taboo porn, featuring submissive teens & virgins in rough sex videos in ultra 4k HD.', parent: 'gamma', parameters: { layout: 'api', scene: 'https://www.puretaboo.com/en/video', referer: 'https://www.puretaboo.com', }, }, { slug: 'realitykings', name: 'Reality Kings', url: 'https://www.realitykings.com', description: 'Home of HD reality porn featuring the nicest tits and ass online! The hottest curvy girls in real amateur sex stories are only on REALITYkings.com', parent: 'aylo', parameters: { childSession: true, parentSession: false, }, }, { slug: 'sayuncle', name: 'Say Uncle', url: 'https://www.sayuncle.com', parent: 'paperstreetmedia', tags: ['gay'], parameters: { endpoint: 'sau-elastic-00gy5fg5ra', }, }, { slug: 'score', name: 'SCORE', url: 'https://www.scorepass.com', description: '', }, { slug: 'sexyhub', name: 'Sexy Hub', url: 'https://www.sexyhub.com', parent: 'aylo', parameters: { parentSession: false, }, }, { slug: 'snowvalley', name: 'Snow Valley Group', hasLogo: false, }, { slug: 'spizoo', name: 'Spizoo', url: 'http://www.spizoo.com', }, { slug: 'teamskeet', name: 'Team Skeet', url: 'https://www.teamskeet.com', description: 'Welcome to teamskeet.com, the largest collection of exclusive teen porn sites and videos on the web. Check out our TeamSkeet porn sites now.', parent: 'paperstreetmedia', parameters: { endpoint: 'ts-elastic-d5cat0jl5o', avatars: 'https://images.mylfcdn.net/tsv4/model/profiles', }, }, { slug: 'teencoreclub', name: 'Teen Core Club', url: 'https://teencoreclub.com', }, { slug: 'teenmegaworld', name: 'TeenMegaWorld', url: 'https://teenmegaworld.net', }, { slug: 'topwebmodels', name: 'Top Web Models', url: 'https://tour.topwebmodels.com', parent: 'radical', parameters: { layout: 'api', endpoint: '7D_7bQ7peaFQgjlOR42GH', videos: 'scenes', }, }, { slug: 'transbella', name: 'Trans Bella', url: 'https://transbella.com', tags: ['transsexual'], parent: 'porndoe', }, { slug: 'traxxx', name: 'traxxx', url: 'https://traxxx.me', }, { slug: 'twistys', name: 'Twistys', url: 'https://www.twistys.com', description: 'The hottest high quality glamour porn for over 18 years! Over 3700+ models and 46000+ scenes. TWISTYS.com', parent: 'aylo', }, { slug: 'vipsexvault', name: 'VIP Sex Vault', url: 'https://vipsexvault.com', parent: 'porndoe', }, { slug: 'vivid', name: 'Vivid', 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', }, { slug: 'vixen', name: 'Vixen', url: 'https://www.vixen.com', description: 'Vixen.com features the world’s finest cinematic adult films with 4K quality and high-end erotic photography.', }, { slug: 'wankzvr', name: 'WankzVR', url: 'https://www.wankzvr.com', }, { slug: 'pierrewoodman', name: 'Pierre Woodman', url: 'http://www.woodmancastingx.com', }, { slug: 'xempire', name: 'XEmpire', url: 'https://www.xempire.com', description: 'XEmpire.com brings you today\'s top pornstars in beautifully shot, HD sex scenes across 4 unique porn sites of gonzo porn, interracial, lesbian & erotica!', parameters: { layout: 'api', actorScenes: 'https://www.xempire.com/en/videos/xempire/latest/{page}/All-Categories/0{actorPath}', sceneMovies: false, }, parent: 'gamma', }, { slug: 'zerotolerance', name: 'Zero Tolerance', alias: ['ztod'], url: 'http://www.ztod.com', parameters: { layout: 'api', }, parent: 'gamma', }, ]; exports.seed = (knex) => Promise.resolve() .then(async () => { await Promise.all([].concat(grandParentNetworks, parentNetworks, networks).map(async (network) => { if (network.rename) { return knex('entities') .where({ type: network.type || 'network', slug: network.rename, }) .update('slug', network.slug); } return null; }).filter(Boolean)); const grandParentNetworkEntries = await upsert('entities', grandParentNetworks.map((network) => (omit({ ...network, type: 'network' }, 'rename'))), ['slug', 'type'], knex); const grandParentNetworksBySlug = [].concat(grandParentNetworkEntries.inserted, grandParentNetworkEntries.updated).reduce((acc, network) => ({ ...acc, [network.slug]: network.id }), {}); const parentNetworksWithGrandParent = parentNetworks.map((network) => ({ slug: network.slug, name: network.name, type: network.type || 'network', alias: network.alias, url: network.url, description: network.description, has_logo: network.hasLogo, showcased: typeof network.showcased === 'boolean' ? network.showcased : true, parameters: network.parameters, parent_id: grandParentNetworksBySlug[network.parent] || null, })); const parentNetworkEntries = await upsert('entities', parentNetworksWithGrandParent, ['slug', 'type'], knex); const parentNetworksBySlug = [].concat(parentNetworkEntries.inserted, parentNetworkEntries.updated).reduce((acc, network) => ({ ...acc, [network.slug]: network.id }), {}); const networksWithParent = networks.map((network) => ({ slug: network.slug, name: network.name, type: network.type || 'network', alias: network.alias, url: network.url, description: network.description, has_logo: network.hasLogo, showcased: typeof network.showcased === 'boolean' ? network.showcased : true, parameters: network.parameters, parent_id: parentNetworksBySlug[network.parent] || grandParentNetworksBySlug[network.parent] || null, })); const networkEntries = await upsert('entities', networksWithParent, ['slug', 'type'], knex); const networkIdsBySlug = [].concat( grandParentNetworkEntries.inserted, grandParentNetworkEntries.updated, parentNetworkEntries.inserted, parentNetworkEntries.updated, networkEntries.inserted, networkEntries.updated, ).reduce((acc, network) => ({ ...acc, [network.slug]: network.id }), {}); const tagSlugs = networks.map((network) => network.tags).flat().filter(Boolean); const tagEntries = await knex('tags').whereIn('slug', tagSlugs); const tagIdsBySlug = tagEntries.reduce((acc, tag) => ({ ...acc, [tag.slug]: tag.id }), {}); const tagAssociations = networks .map((network) => (network.tags ? network.tags.map((tagSlug) => ({ entity_id: networkIdsBySlug[network.slug], tag_id: tagIdsBySlug[tagSlug], inherit: true, })) : [])) .flat(); await upsert('entities_tags', tagAssociations, ['entity_id', 'tag_id'], knex); });