Added support for Reality Kings sites 'Look At Her Now' and 'Tranny Surprise'.

This commit is contained in:
ThePendulum 2019-12-07 00:42:47 +01:00
parent 2a1fd87ee8
commit 98b9c885ec
12 changed files with 142 additions and 68 deletions

View File

@ -483,6 +483,7 @@ export default {
padding: 0 1rem 0 0;
.icon {
color: $highlight;
fill: $highlight;
width: 1.5rem;
height: 1.5rem;

View File

@ -40,8 +40,8 @@
id="namedview36"
showgrid="false"
inkscape:zoom="10.796116"
inkscape:cx="36.555237"
inkscape:cy="24.650121"
inkscape:cx="21.920344"
inkscape:cy="23.631236"
inkscape:window-x="1047"
inkscape:window-y="930"
inkscape:window-maximized="1"
@ -56,35 +56,29 @@
<desc
id="desc4">Created with Sketch.</desc>
<defs
id="defs8">
<polygon
id="path-1"
points="343.86282,220 0.26087996,220 0.26087996,0.11564746 343.86282,0.11564746 " />
<polygon
id="path-3"
points="883.15816,0 0,0 0,220 883.15816,220 " />
</defs>
id="defs8" />
<g
id="Symbols"
style="fill:none;fill-rule:evenodd;stroke:none;stroke-width:1"
style="fill-rule:evenodd;stroke:none;stroke-width:1"
transform="translate(-18.966281,-22.803411)">
<g
id="cliphub">
<g
id="Page-1"
transform="translate(0.79406475,26.176259)"
style="fill:#000000;fill-opacity:1">
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:342.91262817px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill-opacity:1;stroke:none;stroke-width:8.5728159;"
x="-4.7667637"
y="218.76817"
id="text868"><tspan
sodipodi:role="line"
id="tspan866"
x="-4.7667637"
y="218.76817"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';baseline-shift:baseline;stroke-width:8.5728159;fill-opacity:1;">MH</tspan></text>
transform="translate(0.79406475,26.176259)">
<g
aria-label="MH"
style="font-style:normal;font-weight:normal;font-size:342.91262817px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill-opacity:1;stroke:none;stroke-width:8.5728159"
id="text868">
<path
d="M 214.07445,218.76817 V 75.776286 q 0,-4.855696 0,-9.711393 0.16744,-4.855696 1.67438,-41.692013 -11.88809,45.04077 -17.58097,62.789177 L 155.63866,218.76817 H 120.47672 L 77.947513,87.162057 60.031668,24.37288 q 2.009253,38.845571 2.009253,51.403406 V 218.76817 H 18.172216 V -17.151696 h 66.137933 l 42.194331,131.940996 3.68363,12.72527 8.03701,31.64574 10.54859,-37.84094 43.36639,-138.471066 h 65.80306 V 218.76817 Z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';baseline-shift:baseline;fill-opacity:1;stroke-width:8.5728159"
id="path859" />
<path
d="M 456.02208,218.76817 V 117.63574 H 353.21526 V 218.76817 H 303.82111 V -17.151696 h 49.39415 v 93.932609 h 102.80682 v -93.932609 h 49.39415 V 218.76817 Z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';baseline-shift:baseline;fill-opacity:1;stroke-width:8.5728159"
id="path861" />
</g>
</g>
</g>
</g>

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -828,6 +828,7 @@
padding: 0 1rem 0 0;
}
.social-link .icon[data-v-ea0483c2] {
color: rgba(255, 255, 255, 0.5);
fill: rgba(255, 255, 255, 0.5);
width: 1.5rem;
height: 1.5rem;

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -1840,9 +1840,18 @@ function getSites(networksMap) {
network_id: networksMap.private,
},
// REALITY KINGS
{
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: JSON.stringify({ classic: true }),
// parameters: JSON.stringify({ siteId: 300 }),
slug: 'lookathernow',
network_id: networksMap.realitykings,
},
{
name: 'We Live Together',
url: 'https://www.welivetogether.com/',
url: 'https://www.welivetogether.com',
description: "We are girls that love to eat pussy and We Live Together! Every week we go out on the streets, bars, parties, malls... wherever and we pick up the cutest lesbians and invite them to come over and party at our apartment. From our girl friends at college, to roommates, and friends of friends.. we're always looking for the hottest lesbian girls around! We Live Together has hundreds of lesbian videos for you to download right from Reality Kings... it's the sexiest lesbian porn anywhere guys and gals! :-) Come watch us eat pussy and work our dildo magic on gorgeous, sexy girls. We love to get together and get off in steamy hot threesome and foursome lesbian movies! We promise you're going to love our amazing collection of lesbian porn. Thanks for dropping in to the We Live Together Apartment, hope you enjoy your visit! Love xoxo Brittney, Taylor, Nicole & All the Girls",
parameters: JSON.stringify({ siteId: 3 }),
slug: 'welivetogether',
@ -1858,7 +1867,7 @@ function getSites(networksMap) {
},
{
name: 'Dare Dorm',
url: 'https://www.daredorm.com/',
url: 'https://www.daredorm.com',
description: '',
parameters: JSON.stringify({ siteId: 48 }),
slug: 'daredorm',
@ -1866,7 +1875,7 @@ function getSites(networksMap) {
},
{
name: 'GF Revenge',
url: 'https://www.gfrevenge.com/',
url: 'https://www.gfrevenge.com',
description: '',
parameters: JSON.stringify({ siteId: 49 }),
slug: 'gfrevenge',
@ -1890,7 +1899,7 @@ function getSites(networksMap) {
},
{
name: 'Crazy Asian GFs',
url: 'https://www.crazyasiangfs.com/',
url: 'https://www.crazyasiangfs.com',
description: '',
parameters: JSON.stringify({ siteId: 52 }),
slug: 'crazyasiangfs',
@ -1898,7 +1907,7 @@ function getSites(networksMap) {
},
{
name: 'Teens Love Huge Cocks',
url: 'https://www.teenslovehugecocks.com/',
url: 'https://www.teenslovehugecocks.com',
description: "Teens Love Big Cocks is dedicated to providing you the hottest teens getting fucked by the biggest cocks! Every week Reality Kings introduces another teen to a big hot meat rod! When these girls see a big throbbing penis they can't resist shoving it in their hot teen mouths. These girl next door types are no slouches when it comes to oral sex! Watch them deepthroat & gag on a mouth full of cock before taking big hot loads all over their pretty faces. The fun doesn't stop there! These girls love getting their tight teen pussy & asses spread wide and pounded by massive dicks! These girls won't settle for less & there is no dick too large. Start downloading TeensLoveBigCock porn videos & HD quality pictures now and watch teen pussy get fucked like you've never seen before!",
parameters: JSON.stringify({ siteId: 42 }),
slug: 'teenslovehugecocks',
@ -1906,7 +1915,7 @@ function getSites(networksMap) {
},
{
name: 'Big Naturals',
url: 'https://www.bignaturals.com/',
url: 'https://www.bignaturals.com',
description: "If you think there is nothing like big natural breasts, Big Naturals welcomes you home. Reality Kings brings you nothing but the hottest amateur big tit women. We're talking about some seriously big boobs. Sexy women with big bouncy tits who love to get it on. These women don't hesitate to let their big natural tits get fucked and let those massive juggs bounce! Big Naturals has hundreds of high quality videos available for download. If into tits, this is the place to be. There's no plastic parts here, only big natural boobs! There's thousands of high resolution pics available to download as well. Check out any of our top rated scenes for the biggest, huge natural tits. Hooters, fun bags, juggs... whatever you want to call them Reality Kings and Big Naturals have the hottest big boobs you'll find anywhere. Sit back, relax, and watch the titties bounce... Reality Kings style!",
parameters: JSON.stringify({ siteId: 5 }),
slug: 'bignaturals',
@ -1914,7 +1923,7 @@ function getSites(networksMap) {
},
{
name: 'Money Talks',
url: 'https://www.moneytalks.com/',
url: 'https://www.moneytalks.com',
description: "Money Talks... bullshit walks. We all know the saying, but at Reality Kings we like to prove it! Just watch us approach everyday people on the street and ask them what they will do for some real American Greenbacks! Check out smokin' hot amateurs preform in porn videos or watch crazy college kids preform insane stunts on film... all in exchange for cold hard cash. People will do anything when Money Talks! Watch as we offer cash in exchange for one, AMAZING blow job! From crazy Spring Breakers to the girl next door, we find some amazing sluts and see just what they'll do for the loot--girls that give up the booty, for the booty! Arrr! Reality Kings has every high quality Money Talks episode available for download. We're talking about some seriously hot videos here. You won't find this crazy porn content anywhere else! Remember, Money Talks... bullshit walks!",
parameters: JSON.stringify({ siteId: 28 }),
slug: 'moneytalks',
@ -1922,7 +1931,7 @@ function getSites(networksMap) {
},
{
name: 'Moms Lick Teens',
url: 'https://www.momslickteens.com/',
url: 'https://www.momslickteens.com',
description: 'Hot moms know how to fuck, especially when they have a lot of pent up energy. MomsLickTeens.com is where all the magic happens between lustful milf minxes and curious 18+ teen bombshells in HD porn videos. Mature horny women love to sample a fresh batch of pussy and ass whenever possible here at Reality Kings. They love teaching the carnal arts to eager younger women who crave a deeper understanding of the female body. Our bodacious mommies love exploring the anatomy of their fresh-faced lesbian lovers and engage in cunnilingus and anilingus within seconds. Naked women licking, sucking, scissoring, and toying their gaping pussy and assholes with a plethora of adult toys is absolutely riveting to watch. Youll be aroused by RK girls of different ages rolling around together in sweaty sex scenes. Moms Lick Teens features limber tongues exploring the deepest recesses of female erogenous zones often eliciting projectile squirt orgasms. The phenomenon of female ejaculation occurs regularly in our premium erotica so get a load of it while blowing your own load to our buxom mommies today!',
parameters: JSON.stringify({ siteId: 43 }),
slug: 'momslickteens',
@ -1938,7 +1947,7 @@ function getSites(networksMap) {
},
{
name: 'Milf Hunter',
url: 'https://www.milfhunter.com/',
url: 'https://www.milfhunter.com',
description: "Reality Kings presents MILF Hunter the ORIGINAL reality porn site dedicated to MILFs and mature sex content. If you don't know what a MILF is, allow us to explain... we're talking about sex starved, smokin' hot moms that are in need of a little attention--a MILF, a Mother I'd Like to Fuck! We've all seen these moms at the mall, the beach, and around town. Watch every week as the Hunter captures another hottie on film and gives them what they've been craving... some dick! These moms are seriously hot MILFs and they appear in the most incredible high quality pics and movies! We have hundreds of mature porn videos available for you to download. Or if you're looking for photos we have thousands of high resolution MILF porn pics directly from the MILF Hunter! Reality Kings brings you the best mature sex scenes around so why not join the MILF Hunter hunt down mature moms across America...",
parameters: JSON.stringify({ siteId: 2 }),
slug: 'milfhunter',
@ -1962,7 +1971,7 @@ function getSites(networksMap) {
},
{
name: 'Cum Fiesta',
url: 'https://www.cumfiesta.com/',
url: 'https://www.cumfiesta.com',
description: '"Is this the fiesta $4 " Of course, welcome to the Cum Fiesta! Every week Reality Kings welcomes another hottie to the party... the dick sucking party! :-) When the girl (or girls!) arrive they show us the super secret password (watch a trailer to find out) and the party begins! As their clothes come off, these babes begin to show off their amazing oral skills. Amateur chicks taking the biggest facial cumshots, that\'s what Cum Fiesta is about! There are no pansy blow jobs here, these chicks give the best head around, and take huge cum shots to their face at the same time. Download hundreds of high quality videos and pics of semen swallowing hotties. Join the party that features amateurs, newbies, and even the girl next door! These babes love to suck cock and take incredible cum shots you\'ll find no where else! This is no siesta folks, it\'s a Cum Fiesta!',
parameters: JSON.stringify({ siteId: 10 }),
slug: 'cumfiesta',
@ -1970,7 +1979,7 @@ function getSites(networksMap) {
},
{
name: '8th Street Latinas',
url: 'https://www.8thstreetlatinas.com/',
url: 'https://www.8thstreetlatinas.com',
description: "Scientists say that the sun is what makes the temperature rise south of the equator, but we think its the women! If you haven't seen the chicas (women) from 8th Street Latinas, you're in for a spicy treat. From the famous Calle 8 (8th Street) in Miami, Reality Kings brings you the some incredibly hot latinas! We're talking Cubans, Dominicans, Panamanians, and other sexy latinas from South and Central America. These babes aim to please with their tanned bodies and deliciously round asses. Damn, we can't get enough! 8th Street Latinas has some caliente (hot) content for you to download, featuring the hottest latina sex scenes around. These are not tanned white chicks, these are REAL, hot latinas who know how to get your blood pumping. If you think you can handle the heat, grab your pair of shorts and flip-flops and let's head to Miami... 8th Street Latinas has some incredible latina porn for you!",
parameters: JSON.stringify({ siteId: 1 }),
slug: '8thstreetlatinas',
@ -1978,7 +1987,7 @@ function getSites(networksMap) {
},
{
name: "Mike's Apartment",
url: 'http://www.mikesapartment.com/',
url: 'http://www.mikesapartment.com',
description: 'There\'s a room for rent in Mikes Apartment and Mike has found another hot chick to fill the vacancy! Join Mike on his search for roommates to help pay the bills. If these hot euro babes don\'t have the money, that\'s alright, Mike offers them the room in exchange for a few hours of masturbation and fun! And if the girl is traveling with a companion, thats not a problem... Mike just creates another steamy euro sex film for his "private" collection. Seriously, these babes are Europe\'s finest and Mike is your connoisseur of European booty! From their tight bodies, to their thick accents, these ladies know how to please and excite. Reality Kings offers hundreds of our incredible european porn movies and pics for you to download, and you don\'t have to travel to Moscow to get them. If you\'re looking for original, hot, European porn content, welcome to your new home: Mikes Apartment.',
parameters: JSON.stringify({ siteId: 25 }),
slug: 'mikesapartment',
@ -1986,7 +1995,7 @@ function getSites(networksMap) {
},
{
name: 'In the VIP',
url: 'http://www.inthevip.com/',
url: 'http://www.inthevip.com',
description: "Ever wonder what happens In The VIP$3 Reality Kings takes you to the hottest night clubs in the country to show you exactly what goes on in the VIP room. When the club is packed, the music is pumpin', and the ladies are looking this HOT, you know it's going to be a damn good time! Grab a drink and step into the VIP room. Check out these gorgeous babes shaking their asses and flashing the camera. You will never see ladies like this in some whack ass bar, only in the most exclusive VIP rooms. As the party gets going, the clothes come off, and the panties drop! Watch some amazing free VIP porn movies, featuring these hotties having sex VIP style. We're talking about some down and dirty club sex featuring smokin' hot sluts. These chicks came for a good time and they've found it! Join the exclusive party In The VIP.",
parameters: JSON.stringify({ siteId: 22 }),
slug: 'inthevip',
@ -2034,7 +2043,7 @@ function getSites(networksMap) {
},
{
name: 'Captain Stabbin',
url: 'https://www.captainstabbin.com/',
url: 'https://www.captainstabbin.com',
description: "Hop aboard the S.S. Stabbin and join Captain Stabbin on his trip to analize the seven seas! What's better than a girl with a hot pussy$8 A girl with a hot pussy getting poked in the ass! Reality Kings invites you to the worlds greatest anal sex adventure. These babes don't need a boarding pass to climb aboard this ship, only a hot body and a gorgeous ass. Watch as the Captain sets course for the anal islands in search of the best anal sex scenes around! Download hundreds of incredible anal sex movies and pics in stunning high quality formats. Captain Stabbin brings you the very best booty content, from her first anal sex scene, to amazing boat sex scenes at sea, every episode is sure to please! These girls are ready for a stern spanking (pun intended)! Raise the main sail, set course, and join Captain Stabbin on his anal adventure! Arrr!",
parameters: JSON.stringify({ siteId: 8 }),
slug: 'captainstabbin',
@ -2082,7 +2091,7 @@ function getSites(networksMap) {
},
{
name: 'Happy Tugs',
url: 'https://www.happytugs.com/',
url: 'https://www.happytugs.com',
description: "Come on dudes, who doesn't like a happy ending$13 We've all seen those hole in the wall Asian massage parlors! Finally there is a site that celebrates the hand job. Asian beauties rubbing massage oil all over, what could be better$14 These babes know how to work out the kinks, seriously amazing rub 'n tug jobs. Happy Tugs captures hidden camera footage from inside one of the country's best sexual massage parlors. The dudes come in looking for a little rub down and, for a few dollars more, get a full servicing. It doesn't get any better than this, hand jobs and hot Asian babes. Check out our amazing happy ending videos, with babes rubbing their oil soaked breasts all over their favorite customers. Strip down, jump on the massage table and get your wallet out, Happy Tugs will ensure you get a very happy ending!",
parameters: JSON.stringify({ siteId: 19 }),
slug: 'happytugs',
@ -2162,7 +2171,7 @@ function getSites(networksMap) {
},
{
name: 'Moms Bang Teens',
url: 'https://www.momsbangteens.com/',
url: 'https://www.momsbangteens.com',
description: "Reality Kings presents the first website dedicated to hot moms who love to bang 18+ teens. Moms Bang Teens features the sexiest MILFs on the web, and these MILFs are all about fucking young guys on camera. If you remember lusting after one of your friend's hot moms back in grade school, then you know exactly what Moms Bang Teens is all about. Imagine if instead of just fantasizing about that sexy mother, you actually got to bang her. These are the same hot moms you see at your local supermarket and shopping at your neighborhood mall. Some of them are married and never get the attention they need. While others are just horny and sexy moms who never got tied down with a husband. Instead they like to go out and find hot young studs that know how to fuck them right. These are experienced and mature women who know what they want; young 18+ teens that can give them that rock hard cock.",
parameters: JSON.stringify({ siteId: 27 }),
slug: 'momsbangteens',
@ -2170,7 +2179,7 @@ function getSites(networksMap) {
},
{
name: 'Sneaky Sex',
url: 'https://www.sneakysex.com/',
url: 'https://www.sneakysex.com',
description: 'Sneaky dirty sex! They are fucking and nobody can see, otherwise they will have a HUGE problem. When no one is watching, these horny MILFs and Teens are having sneaky sex!',
parameters: JSON.stringify({ siteId: 46 }),
slug: 'sneakysex',
@ -2210,9 +2219,9 @@ function getSites(networksMap) {
},
{
name: 'Tranny Surprise',
url: 'https://www.trannysurprise.com/',
url: 'https://www.trannysurprise.com',
description: 'If youre in the mood for graphic tranny porn, look no further than TrannySurprise.com. A sexy shemale is a thing of beauty, often possessing a voracious appetite for sex. Reality Kings is home to some of the most incredible transsexual pornstars on the net. Watch them stroke their huge dicks and massage their voluminous ball sacks in our full-length HD videos. All these goddesses want to do is suck dick until it erupts in their wide open mouths. Cum swallowing is their specialty so enjoy our scenes full of creamy jizz loads overflowing onto their giant tits and firm stomachs. These nude RK shemales live to get rimjobs before getting drilled by gigantic dicks. Messy creampies are usually how their nights end so witness the torrid fuck marathons leading up to juicy orgasms. Tranny Surprise features sensual ladyboys that know just how to please anyone looking to take a walk on the wild side. Premium porno is what you deserve so eat it all up with our luscious, busty trannies. Long legs, tight asses, toned physiques, and a healthy dose of raw animal passion is what our “chicks with dicks” deliver in every one of our erotic films.',
parameters: null,
parameters: JSON.stringify({ classic: true }),
slug: 'trannysurprise',
network_id: networksMap.realitykings,
},
@ -2242,7 +2251,7 @@ function getSites(networksMap) {
},
{
name: 'Round and Brown',
url: 'https://www.roundandbrown.com/',
url: 'https://www.roundandbrown.com',
description: 'Chocolate lovers out there, Reality Kings presents to you... Round And Brown, the porn site that caters to horny dudes who have a mighty craving for fine "sistah" booties. The ladies featured in these ebony porn movies are SIZZLING HOT, like a newly melted chocolate fondue! We\'re talking about some damn fine black booties! If it\'s Round And Brown, it gets the special lube treatment, no exceptions! Think you can handle this collection of premium ebony ass$1 There\'s no skinny white girls here, only gorgeous black beauties with deliciously round booties, featured in the best hardcore ebony sex videos around! Reality Kings is the only one who can bring you this amazing collection of black girl porn. If you love big round asses, gorgeous black babes, and amazing tits we have the videos and pics you\'re looking for. Warning: This chocolate may melt in your hand and your mouth... but who cares, if it\'s Round And Brown!',
parameters: JSON.stringify({ siteId: 33 }),
slug: 'roundandbrown',

View File

@ -434,6 +434,12 @@ function getTags(groupsMap) {
priority: 9,
group_id: groupsMap.group,
},
{
name: 'glasses',
slug: 'glasses',
alias_for: null,
group_id: groupsMap.clothing,
},
{
name: 'trainbang',
slug: 'trainbang',
@ -464,6 +470,11 @@ function getTags(groupsMap) {
alias_for: null,
group_id: groupsMap.body,
},
{
name: 'handjob',
slug: 'handjob',
alias_for: null,
},
{
name: 'hardcore',
slug: 'hardcore',
@ -1123,6 +1134,10 @@ function getTagAliases(tagsMap) {
name: 'doggystyle',
alias_for: tagsMap['doggy-style'],
},
{
name: 'doggy style - pov',
alias_for: tagsMap['doggy-style'],
},
{
name: 'doggie style',
alias_for: tagsMap['doggy-style'],
@ -1239,6 +1254,10 @@ function getTagAliases(tagsMap) {
name: 'facials',
alias_for: tagsMap.facial,
},
{
name: 'facial - multiple',
alias_for: tagsMap.facial,
},
{
name: 'fake boobs',
alias_for: tagsMap['enhanced-boobs'],

View File

@ -25,7 +25,7 @@ const { argv } = yargs
alias: 'actor',
})
.option('sources', {
describe: 'Only use these scrapers for actor data',
describe: 'Use these scrapers for actor data',
type: 'array',
alias: 'source',
})

View File

@ -30,12 +30,15 @@ async function findSite(url, release) {
async function scrapeRelease(url, release, deep = false) {
const site = await findSite(url, release);
const scraper = scrapers.releases[site.slug] || scrapers.releases[site.network.slug];
console.log(url, site);
if (!site) {
throw new Error('Could not find site in database');
}
const scraper = scrapers.releases[site.slug] || scrapers.releases[site.network.slug];
if (!scraper) {
throw new Error('Could not find scraper for URL');
}

View File

@ -4,11 +4,10 @@
const Promise = require('bluebird');
const bhttp = require('bhttp');
const { CookieJar } = Promise.promisifyAll(require('tough-cookie'));
const cheerio = require('cheerio');
const moment = require('moment');
const { fetchSites } = require('../sites');
const { cookieToData } = require('../utils/cookies');
const { matchTags } = require('../tags');
function getThumbs(scene) {
if (scene.images.poster) {
@ -31,11 +30,11 @@ async function scrapeLatest(items, site) {
const date = new Date(data.dateReleased);
const actors = data.actors.map(actor => actor.name);
const rawTags = data.tags.map(tag => tag.name);
const tags = await matchTags(rawTags);
const tags = data.tags.map(tag => tag.name);
const [poster, ...photos] = getThumbs(data);
const trailer = data.videos.mediabook && (data.videos.mediabook.files['720p'] || data.videos.mediabook.files['320p']);
const duration = data.videos.mediabook && data.videos.mediabook.length;
return {
url,
@ -44,6 +43,7 @@ async function scrapeLatest(items, site) {
description,
actors,
tags,
duration,
poster,
photos,
trailer: trailer && {
@ -56,31 +56,62 @@ async function scrapeLatest(items, site) {
}));
}
function scrapeLatestClassic(html, site) {
const $ = cheerio.load(html, { normalizeWhitespace: true });
const stateTag = $('script:contains("initialState")').html();
const prefix = 'initialState = {';
const prefixIndex = stateTag.indexOf('initialState = {');
const suffix = '};';
const stateString = stateTag.slice(prefixIndex + prefix.length - 1, stateTag.indexOf('};', prefixIndex) + suffix.length - 1);
const data = JSON.parse(stateString);
return Object.values(data.entities.releases).map((scene) => {
const release = { site };
release.entryId = scene.id;
release.url = `${site.url}/scene/${release.entryId}/`;
release.title = scene.title;
release.description = scene.description;
release.date = new Date(scene.dateReleased);
release.actors = scene.actors.map(actorId => data.entities.actors[actorId].name);
release.tags = scene.tags.map(tagId => data.entities.tags[tagId].name);
const [poster, ...photos] = getThumbs(scene);
release.poster = poster;
release.photos = photos;
if (scene.videos.mediabook) {
const trailer = (scene.videos.mediabook.files['720p'] || scene.videos.mediabook.files['320p']);
release.duration = scene.videos.mediabook.length;
release.trailer = trailer && {
src: trailer.urls.view,
quality: parseInt(trailer.format, 10),
};
}
return release;
});
}
async function scrapeScene(data, url, site) {
const { id: entryId, title, description } = data;
const date = new Date(data.dateReleased);
const actors = data.actors.map(actor => actor.name);
const rawTags = data.tags.map(tag => tag.name);
const tags = data.tags.map(tag => tag.name);
const [poster, ...photos] = getThumbs(data);
const trailer = data.videos.mediabook && (data.videos.mediabook.files['720p'] || data.videos.mediabook.files['320p']);
const siteName = data.collections[0].name;
const siteId = data.collections[0].id;
const siteSlug = siteName.replace(/\s+/g, '').toLowerCase();
const siteUrl = `https://www.realitykings.com/scenes?site=${siteId}`;
const [[channelSite], tags] = await Promise.all([
site.isFallback
? fetchSites({
slug: siteSlug,
name: siteName,
url: siteUrl,
})
: [site],
matchTags(rawTags),
]);
// const siteId = data.collections[0].id;
const channel = siteName.replace(/\s+/g, '').toLowerCase();
// const siteUrl = `https://www.realitykings.com/scenes?site=${siteId}`;
return {
url,
@ -96,7 +127,8 @@ async function scrapeScene(data, url, site) {
quality: parseInt(trailer.format, 10),
},
date,
site: channelSite,
site,
channel,
};
}
@ -114,7 +146,21 @@ function getUrl(site) {
throw new Error(`Reality Kings site '${site.name}' (${site.url}) not supported`);
}
async function fetchClassic(site, page) {
const res = await bhttp.get(`${site.url}/scenes?page=${page}`);
if (res.statusCode === 200) {
return scrapeLatestClassic(res.body.toString(), site);
}
return null;
}
async function fetchLatest(site, page = 1) {
if (site.parameters && site.parameters.classic) {
return fetchClassic(site, page);
}
const url = getUrl(site);
const { search } = new URL(url);
const siteId = new URLSearchParams(search).get('site');
@ -129,7 +175,8 @@ async function fetchLatest(site, page = 1) {
const beforeDate = moment().add('1', 'day').format('YYYY-MM-DD');
const limit = 10;
const res = await session.get(`https://site-api.project1service.com/v2/releases?collectionId=${siteId}&dateReleased=<${beforeDate}&limit=${limit}&offset=${limit * (page - 1)}&orderBy=-dateReleased&type=scene`, {
const apiUrl = `https://site-api.project1service.com/v2/releases?collectionId=${siteId}&dateReleased=<${beforeDate}&limit=${limit}&offset=${limit * (page - 1)}&orderBy=-dateReleased&type=scene`;
const res = await session.get(apiUrl, {
headers: {
Instance: instanceToken,
},

View File

@ -62,7 +62,7 @@ async function findSiteByUrl(url) {
'sites.*',
'networks.name as network_name', 'networks.slug as network_slug', 'networks.url as network_url', 'networks.description as network_description', 'networks.parameters as network_parameters',
)
.where('sites.url', 'like', `%${domain}`)
.where('sites.url', 'like', `%${domain}%`)
.first();
if (site) {