2020-01-14 03:50:42 +00:00
'use strict' ;
/* eslint-disable newline-per-chained-call */
const Promise = require ( 'bluebird' ) ;
const { CookieJar } = Promise . promisifyAll ( require ( 'tough-cookie' ) ) ;
2021-03-23 14:25:21 +00:00
const cookie = require ( 'cookie' ) ;
2020-01-14 03:50:42 +00:00
const moment = require ( 'moment' ) ;
2020-07-20 23:44:51 +00:00
const qu = require ( '../utils/qu' ) ;
2020-02-29 04:00:50 +00:00
const slugify = require ( '../utils/slugify' ) ;
2020-11-22 23:05:02 +00:00
const http = require ( '../utils/http' ) ;
2020-01-27 21:54:14 +00:00
const { inchesToCm , lbsToKg } = require ( '../utils/convert' ) ;
2020-01-14 03:50:42 +00:00
2022-03-04 22:31:59 +00:00
function getBasePath ( channel , path = '/scene' ) {
return channel . parameters ? . scene
|| ( ( channel . parameters ? . native || channel . type === 'network' ) && ` ${ channel . url } ${ path } ` )
|| ` ${ channel . parent . url } ${ path } ` ;
}
2020-01-14 03:50:42 +00:00
function getThumbs ( scene ) {
2020-05-14 02:26:05 +00:00
if ( scene . images . poster ) {
2021-02-22 01:33:39 +00:00
return Object . values ( scene . images . poster ) // can be { 0: {}, 1: {}, ... } instead of array
2021-11-20 22:59:15 +00:00
. filter ( ( img ) => typeof img === 'object' ) // remove alternateText property
. map ( ( image ) => image . xl . url ) ;
2020-05-14 02:26:05 +00:00
}
2020-01-14 03:50:42 +00:00
2022-03-04 22:31:59 +00:00
if ( Array . isArray ( scene . images . card _main _rect ) ) {
2020-05-14 02:26:05 +00:00
return scene . images . card _main _rect
. concat ( scene . images . card _secondary _rect || [ ] )
2021-11-20 22:59:15 +00:00
. map ( ( image ) => image . xl . url . replace ( '.thumb' , '' ) ) ;
2020-05-14 02:26:05 +00:00
}
2020-01-14 03:50:42 +00:00
2020-05-14 02:26:05 +00:00
return [ ] ;
2020-01-14 03:50:42 +00:00
}
2022-03-26 16:40:20 +00:00
function getCovers ( images , target = 'cover' ) {
if ( ! images [ target ] ) {
return [ ] ;
}
const covers = [
images [ target ] [ 0 ] . md ? . url ,
images [ target ] [ 0 ] . sm ? . url ,
images [ target ] [ 0 ] . xs ? . url ,
// bigger but usually upscaled
images [ target ] [ 0 ] . xx ? . url ,
images [ target ] [ 0 ] . xl ? . url ,
images [ target ] [ 0 ] . lg ? . url ,
2022-03-04 22:31:59 +00:00
] ;
2022-03-26 16:40:20 +00:00
if ( target === 'poster' ) {
return covers ;
}
return [ covers ] ;
2022-03-04 22:31:59 +00:00
}
2020-08-24 03:13:34 +00:00
function getVideos ( data ) {
const teaserSources = data . videos . mediabook ? . files ;
2021-11-20 22:59:15 +00:00
const trailerSources = data . children . find ( ( child ) => child . type === 'trailer' ) ? . videos . full ? . files ;
2020-08-24 03:13:34 +00:00
2021-11-20 22:59:15 +00:00
const teaser = teaserSources && Object . values ( teaserSources ) . map ( ( source ) => ( {
2020-08-24 03:13:34 +00:00
src : source . urls . view ,
quality : parseInt ( source . format , 10 ) ,
} ) ) ;
2021-11-20 22:59:15 +00:00
const trailer = trailerSources && Object . values ( trailerSources ) . map ( ( source ) => ( {
2020-08-24 03:13:34 +00:00
src : source . urls . view ,
quality : parseInt ( source . format , 10 ) ,
} ) ) ;
return { teaser , trailer } ;
}
function scrapeLatestX ( data , site , filterChannel ) {
2020-05-14 02:26:05 +00:00
const release = {
entryId : data . id ,
title : data . title ,
description : data . description ,
} ;
2020-02-19 03:41:53 +00:00
2022-03-04 22:31:59 +00:00
const basepath = getBasePath ( site ) ;
2020-02-19 03:41:53 +00:00
2021-02-10 02:23:48 +00:00
release . url = ` ${ basepath } / ${ release . entryId } / ${ slugify ( release . title ) } ` ;
2020-05-14 02:26:05 +00:00
release . date = new Date ( data . dateReleased ) ;
2021-10-17 17:59:05 +00:00
release . duration = data . videos . mediabook ? . length > 1 ? data . videos . mediabook . length : null ;
2020-02-19 03:41:53 +00:00
2021-11-20 22:59:15 +00:00
release . actors = data . actors . map ( ( actor ) => ( { name : actor . name , gender : actor . gender } ) ) ;
release . tags = data . tags . map ( ( tag ) => tag . name ) ;
2020-02-19 03:41:53 +00:00
2020-05-14 02:26:05 +00:00
[ release . poster , ... release . photos ] = getThumbs ( data ) ;
2020-02-19 03:41:53 +00:00
2020-08-24 03:13:34 +00:00
const { teaser , trailer } = getVideos ( data ) ;
2020-02-19 03:41:53 +00:00
2020-08-24 03:13:34 +00:00
if ( teaser ) release . teaser = teaser ;
if ( trailer ) release . trailer = trailer ;
2020-02-19 03:41:53 +00:00
2021-11-20 22:59:15 +00:00
release . chapters = data . timeTags ? . map ( ( chapter ) => ( {
2021-02-27 17:05:06 +00:00
time : chapter . startTime ,
duration : chapter . endTime - chapter . startTime ,
tags : [ chapter . name ] ,
} ) ) ;
2021-10-28 00:10:30 +00:00
if ( ( site . parameters ? . extract === true && data . collections . length > 0 ) // release should not belong to any channel
2021-11-20 22:59:15 +00:00
|| ( typeof site . parameters ? . extract === 'string' && ! data . collections . some ( ( collection ) => collection . shortName === site . parameters . extract ) ) // release should belong to specific channel
|| ( filterChannel && ! data . collections ? . some ( ( collection ) => collection . id === site . parameters ? . siteId ) ) ) { // used to separate upcoming Brazzers scenes
2021-10-28 00:10:30 +00:00
return {
... release ,
exclude : true ,
} ;
}
2022-03-09 22:26:48 +00:00
const siteName = data . collections [ 0 ] ? . name || data . brand ;
release . channel = slugify ( siteName , '' ) ;
2020-05-14 02:26:05 +00:00
return release ;
2020-01-14 03:50:42 +00:00
}
2020-08-24 03:13:34 +00:00
async function scrapeLatest ( items , site , filterChannel ) {
2021-11-20 22:59:15 +00:00
const latestReleases = items . map ( ( data ) => scrapeLatestX ( data , site , filterChannel ) ) ;
2020-02-04 02:12:09 +00:00
2021-10-27 23:59:53 +00:00
return {
2021-11-20 22:59:15 +00:00
scenes : latestReleases . filter ( ( scene ) => ! scene . exclude ) ,
unextracted : latestReleases . filter ( ( scene ) => scene . exclude ) ,
2021-10-27 23:59:53 +00:00
} ;
2020-01-14 03:50:42 +00:00
}
2022-03-04 22:31:59 +00:00
function scrapeRelease ( data , url , channel , networkName ) {
2020-05-14 02:26:05 +00:00
const release = { } ;
2020-02-01 03:42:35 +00:00
2020-05-14 02:26:05 +00:00
const { id : entryId , title , description } = data ;
2020-01-14 03:50:42 +00:00
2020-05-14 02:26:05 +00:00
release . entryId = data . id ;
release . title = title ;
release . description = description ;
2020-01-14 03:50:42 +00:00
2020-05-14 02:26:05 +00:00
release . date = new Date ( data . dateReleased ) ;
2021-10-17 17:59:05 +00:00
release . duration = data . videos . mediabook ? . length > 1 ? data . videos . mediabook . length : null ;
2020-01-14 03:50:42 +00:00
2021-11-20 22:59:15 +00:00
release . actors = data . actors . map ( ( actor ) => ( { name : actor . name , gender : actor . gender } ) ) ;
release . tags = data . tags . map ( ( tag ) => tag . name ) ;
2020-01-14 03:50:42 +00:00
2020-05-14 02:26:05 +00:00
[ release . poster , ... release . photos ] = getThumbs ( data ) ;
2020-02-01 03:42:35 +00:00
2020-08-24 03:13:34 +00:00
const { teaser , trailer } = getVideos ( data ) ;
2020-02-19 03:41:53 +00:00
2020-08-24 03:13:34 +00:00
if ( teaser ) release . teaser = teaser ;
if ( trailer ) release . trailer = trailer ;
2020-02-01 03:42:35 +00:00
2021-11-20 22:59:15 +00:00
release . chapters = data . timeTags ? . map ( ( chapter ) => ( {
2021-02-27 17:05:06 +00:00
time : chapter . startTime ,
duration : chapter . endTime - chapter . startTime ,
tags : [ chapter . name ] ,
} ) ) ;
2020-05-14 02:26:05 +00:00
const siteName = data . collections [ 0 ] ? . name || data . brand ;
release . channel = slugify ( siteName , '' ) ;
2020-02-01 03:42:35 +00:00
2020-05-14 02:26:05 +00:00
release . url = url || ` https://www. ${ networkName || data . brand } .com/scene/ ${ entryId } / ` ;
2020-02-01 03:42:35 +00:00
2022-03-09 22:26:48 +00:00
if ( data . parent ? . type === 'movie' || data . parent ? . type === 'serie' ) {
release [ data . parent . type ] = {
2022-03-04 22:31:59 +00:00
entryId : data . parent . id ,
2022-03-26 16:40:20 +00:00
url : ` ${ getBasePath ( channel , data . parent . type === 'movie' ? '/movie' : '/series' ) } / ${ data . parent . id } / ${ slugify ( data . parent . title , '-' , { removePunctuation : true } )} ` ,
2022-03-04 22:31:59 +00:00
title : data . parent . title ,
description : data . parent . description ,
date : new Date ( data . parent . dateReleased ) ,
channel : slugify ( data . parent . collections ? . name || data . parent . brand ) ,
2022-03-26 16:40:20 +00:00
poster : getCovers ( data . parent . images , 'poster' ) ,
2022-03-04 22:31:59 +00:00
shallow : true ,
} ;
}
if ( data . type === 'movie' ) {
release . covers = getCovers ( data . images ) ;
release . scenes = data . children ? . map ( ( scene ) => ( {
entryId : scene . id ,
url : ` ${ getBasePath ( channel ) } / ${ scene . id } / ${ slugify ( scene . title ) } ` ,
title : scene . title ,
shallow : true ,
} ) ) ;
}
2020-05-14 02:26:05 +00:00
return release ;
2020-01-14 03:50:42 +00:00
}
function getUrl ( site ) {
2023-03-26 22:01:38 +00:00
const { searchParams , pathname } = new URL ( site . url ) ;
2020-01-14 03:50:42 +00:00
2020-09-18 00:54:05 +00:00
// if (search.match(/\?site=\d+/)) {
2023-03-26 22:01:38 +00:00
if ( searchParams . has ( 'site' ) || /\/site\/\d+/ . test ( pathname ) ) {
2020-05-14 02:26:05 +00:00
return site . url ;
}
2020-01-14 03:50:42 +00:00
2020-05-14 02:26:05 +00:00
if ( site . parameters ? . native ) {
return ` ${ site . url } /scenes ` ;
}
2020-01-30 00:14:31 +00:00
2020-05-14 02:26:05 +00:00
if ( site . parameters ? . extract ) {
return ` ${ site . url } /scenes ` ;
}
2020-01-30 00:14:31 +00:00
2020-05-14 02:26:05 +00:00
if ( site . parameters ? . siteId ) {
2020-06-28 20:29:18 +00:00
return ` ${ site . parent . url } /scenes?site= ${ site . parameters . siteId } ` ;
2020-05-14 02:26:05 +00:00
}
2020-01-14 03:50:42 +00:00
2020-05-14 02:26:05 +00:00
throw new Error ( ` Mind Geek site ' ${ site . name } ' ( ${ site . url } ) not supported ` ) ;
2020-01-14 03:50:42 +00:00
}
2022-02-11 21:14:44 +00:00
async function getSession ( site , parameters , url ) {
if ( site . slug === 'mindgeek' || site . parameters ? . parentSession === false ) {
2021-11-22 01:51:52 +00:00
// most MG sites have a parent network to acquire a session from, don't try to acquire session from mindgeek.com for independent channels
return null ;
}
2020-05-14 02:26:05 +00:00
const cookieJar = new CookieJar ( ) ;
2020-11-22 23:05:02 +00:00
const session = http . session ( { cookieJar } ) ;
2020-01-14 03:50:42 +00:00
2021-01-05 15:27:20 +00:00
const sessionUrl = site . parameters ? . siteId && ! ( site . parameters ? . native || site . parameters ? . childSession || site . parent ? . parameters ? . childSession )
2020-09-18 01:27:00 +00:00
? site . parent . url
2022-02-11 21:14:44 +00:00
: ( url || site . url ) ;
2020-09-18 01:27:00 +00:00
2021-02-10 02:23:48 +00:00
const res = await http . get ( sessionUrl , {
session ,
2022-03-29 23:17:54 +00:00
headers : {
'Accept-Language' : 'en-US,en;' , // somehow seems essential for some MG sites
2023-11-30 02:12:47 +00:00
Connection : 'keep-alive' ,
'User-Agent' : 'HTTPie/3.2.1' ,
2022-03-29 23:17:54 +00:00
} ,
2021-02-10 02:23:48 +00:00
interval : parameters ? . interval ,
concurrency : parameters ? . concurrency ,
2021-10-25 00:06:24 +00:00
parse : false ,
2021-02-10 02:23:48 +00:00
} ) ;
2020-01-14 03:50:42 +00:00
2023-11-30 02:12:47 +00:00
if ( res . status === 200 ) {
2020-09-18 01:27:00 +00:00
const cookieString = await cookieJar . getCookieStringAsync ( sessionUrl ) ;
2021-03-23 14:25:21 +00:00
const { instance _token : instanceToken } = cookie . parse ( cookieString ) ;
2020-08-26 00:01:38 +00:00
2022-02-11 21:14:44 +00:00
if ( instanceToken ) {
return { session , instanceToken } ;
}
2020-08-26 00:01:38 +00:00
}
2020-01-14 03:50:42 +00:00
2021-01-05 15:35:49 +00:00
throw new Error ( ` Failed to acquire MindGeek session ( ${ res . statusCode } ) ` ) ;
2020-01-27 21:54:14 +00:00
}
2023-11-30 02:12:47 +00:00
function scrapeProfile ( data , networkName , releases = [ ] ) {
2020-05-14 02:26:05 +00:00
const profile = {
description : data . bio ,
2022-05-29 22:05:33 +00:00
aliases : data . aliases . filter ( Boolean ) ,
2020-05-14 02:26:05 +00:00
} ;
2020-01-27 21:54:14 +00:00
2020-05-14 02:26:05 +00:00
profile . gender = data . gender === 'other' ? 'transsexual' : data . gender ;
2022-05-29 22:05:33 +00:00
profile . measurements = data . measurements ;
2020-01-30 23:25:51 +00:00
2022-05-29 22:05:33 +00:00
profile . dateOfBirth = qu . parseDate ( data . birthday ) ;
profile . birthPlace = data . birthPlace ;
profile . height = inchesToCm ( data . height ) ;
profile . weight = lbsToKg ( data . weight ) ;
2021-02-02 23:46:59 +00:00
2022-05-29 22:05:33 +00:00
profile . hairColor = data . tags . find ( ( tag ) => / hair color / i . test ( tag . category ) ) ? . name ;
profile . ethnicity = data . tags . find ( ( tag ) => / ethnicity / i . test ( tag . category ) ) ? . name ;
2020-01-27 21:54:14 +00:00
2020-05-14 02:26:05 +00:00
if ( data . images . card _main _rect ? . [ 0 ] ) {
profile . avatar = data . images . card _main _rect [ 0 ] . xl ? . url
2020-01-29 01:31:55 +00:00
|| data . images . card _main _rect [ 0 ] . lg ? . url
|| data . images . card _main _rect [ 0 ] . md ? . url
|| data . images . card _main _rect [ 0 ] . sm ? . url
|| data . images . card _main _rect [ 0 ] . xs ? . url ;
2020-05-14 02:26:05 +00:00
}
2020-01-27 21:54:14 +00:00
2021-11-20 22:59:15 +00:00
if ( data . tags . some ( ( tag ) => / boob type / i . test ( tag . category ) && /natural tits/i . test ( tag . name ) ) ) {
2021-02-02 23:46:59 +00:00
profile . naturalBoobs = true ;
}
2021-11-20 22:59:15 +00:00
if ( data . tags . some ( ( tag ) => / boob type / i . test ( tag . category ) && /enhanced/i . test ( tag . name ) ) ) {
2021-02-02 23:46:59 +00:00
profile . naturalBoobs = false ;
}
2022-05-29 22:05:33 +00:00
if ( data . tags . some ( ( tag ) => / body art / i . test ( tag . category ) && /tattoo/i . test ( tag . name ) ) ) {
profile . hasTattoos = true ;
}
if ( data . tags . some ( ( tag ) => / body art / i . test ( tag . category ) && /piercing/i . test ( tag . name ) ) ) {
profile . hasPiercings = true ;
}
2022-03-04 22:31:59 +00:00
profile . releases = releases . map ( ( release ) => scrapeRelease ( release , null , null , networkName ) ) ;
2020-02-01 03:42:35 +00:00
2020-05-14 02:26:05 +00:00
return profile ;
2020-01-27 21:54:14 +00:00
}
2021-02-10 02:23:48 +00:00
async function fetchLatest ( site , page = 1 , options ) {
2020-05-14 02:26:05 +00:00
const url = getUrl ( site ) ;
2023-03-26 22:01:38 +00:00
const { searchParams , pathname } = new URL ( url ) ;
const siteId = searchParams . get ( 'site' ) || Number ( pathname . match ( /\/site\/(\d+)\// ) ? . [ 1 ] ) ;
if ( ! siteId && ! site . parameters ? . native && ! site . parameters ? . extract ) {
return null ;
}
2020-05-14 02:26:05 +00:00
2023-12-01 01:09:24 +00:00
const { instanceToken } = options . beforeNetwork ? . instanceToken
2022-02-11 21:14:44 +00:00
? options . beforeNetwork
: await getSession ( site , options . parameters , url ) ;
2021-11-27 22:55:16 +00:00
2020-05-14 02:26:05 +00:00
const beforeDate = moment ( ) . add ( '1' , 'day' ) . format ( 'YYYY-MM-DD' ) ;
2021-10-27 23:59:53 +00:00
const limit = 24 ;
2020-05-14 02:26:05 +00:00
const apiUrl = site . parameters ? . native || site . parameters ? . extract
? ` https://site-api.project1service.com/v2/releases?dateReleased=< ${ beforeDate } &limit= ${ limit } &offset= ${ limit * ( page - 1 ) } &orderBy=-dateReleased&type=scene `
: ` https://site-api.project1service.com/v2/releases?collectionId= ${ siteId } &dateReleased=< ${ beforeDate } &limit= ${ limit } &offset= ${ limit * ( page - 1 ) } &orderBy=-dateReleased&type=scene ` ;
2020-11-22 23:05:02 +00:00
const res = await http . get ( apiUrl , {
2021-02-10 02:23:48 +00:00
interval : options . parameters . interval ,
concurrency : options . parameters . concurrency ,
2020-05-14 02:26:05 +00:00
headers : {
Instance : instanceToken ,
Origin : site . url ,
Referer : url ,
2022-03-29 23:17:54 +00:00
'Accept-Language' : 'en-US,en;' , // somehow seems essential for some MG sites
2020-05-14 02:26:05 +00:00
} ,
} ) ;
2021-03-23 14:25:21 +00:00
if ( res . status === 200 && res . body . result ) {
2020-05-14 02:26:05 +00:00
return scrapeLatest ( res . body . result , site ) ;
}
2021-03-23 14:25:21 +00:00
return res . statusCode ;
2020-01-14 03:50:42 +00:00
}
2021-02-10 02:23:48 +00:00
async function fetchUpcoming ( site , page , options ) {
2020-08-24 03:13:34 +00:00
const url = getUrl ( site ) ;
2021-02-10 02:23:48 +00:00
const { session , instanceToken } = await getSession ( site , options . parameters ) ;
2020-08-24 03:13:34 +00:00
const apiUrl = 'https://site-api.project1service.com/v2/upcoming-releases' ;
2020-11-22 23:05:02 +00:00
const res = await http . get ( apiUrl , {
session ,
2021-02-10 02:23:48 +00:00
interval : options . parameters . interval ,
concurrency : options . parameters . concurrency ,
2020-08-24 03:13:34 +00:00
headers : {
Instance : instanceToken ,
Origin : site . url ,
Referer : url ,
2022-03-29 23:17:54 +00:00
'Accept-Language' : 'en-US,en;' , // somehow seems essential for some MG sites
2020-08-24 03:13:34 +00:00
} ,
} ) ;
if ( res . statusCode === 200 && res . body . result ) {
return scrapeLatest ( res . body . result , site , true ) ;
}
2021-03-23 14:25:21 +00:00
return res . statusCode ;
2020-08-24 03:13:34 +00:00
}
2022-03-04 22:31:59 +00:00
async function fetchRelease ( url , site , baseScene , options ) {
2022-03-26 23:27:26 +00:00
if ( baseScene ? . entryId && ! baseScene . shallow && ! options . parameters . forceDeep ) {
2020-08-26 00:01:38 +00:00
// overview and deep data is the same, don't hit server unnecessarily
return baseScene ;
}
2021-02-27 17:05:06 +00:00
const entryId = new URL ( url ) . pathname . match ( /\/(\d+)/ ) ? . [ 1 ] ;
2021-10-27 15:19:23 +00:00
const { session , instanceToken } = options . beforeFetchScenes || await getSession ( site , options . parameters ) ;
2020-01-14 03:50:42 +00:00
2020-11-22 23:05:02 +00:00
const res = await http . get ( ` https://site-api.project1service.com/v2/releases/ ${ entryId } ` , {
session ,
2021-02-10 02:23:48 +00:00
interval : options . parameters . interval ,
concurrency : options . parameters . concurrency ,
2020-05-14 02:26:05 +00:00
headers : {
Instance : instanceToken ,
2022-03-29 23:17:54 +00:00
'Accept-Language' : 'en-US,en;' , // somehow seems essential for some MG sites
2020-05-14 02:26:05 +00:00
} ,
} ) ;
2020-01-14 03:50:42 +00:00
2021-03-23 14:25:21 +00:00
if ( res . status === 200 && res . body . result ) {
2021-10-26 21:42:32 +00:00
return {
2022-03-04 22:31:59 +00:00
scene : scrapeRelease ( res . body . result , url , site ) ,
2021-10-26 21:42:32 +00:00
} ;
2020-05-14 02:26:05 +00:00
}
2020-01-30 00:14:31 +00:00
2020-05-14 02:26:05 +00:00
return null ;
2020-01-27 21:54:14 +00:00
}
2020-01-14 03:50:42 +00:00
2022-05-29 22:05:33 +00:00
async function fetchProfile ( { name : actorName } , { entity , parameters } , include ) {
2020-09-18 01:27:00 +00:00
// const url = `https://www.${networkOrNetworkSlug.slug || networkOrNetworkSlug}.com`;
2021-02-10 02:23:48 +00:00
const { session , instanceToken } = await getSession ( entity , parameters ) ;
2020-05-14 02:26:05 +00:00
2020-11-22 23:05:02 +00:00
const res = await http . get ( ` https://site-api.project1service.com/v1/actors/?search= ${ encodeURI ( actorName ) } ` , {
session ,
2021-02-10 02:23:48 +00:00
interval : parameters . interval ,
concurrency : parameters . concurrency ,
2020-05-14 02:26:05 +00:00
headers : {
Instance : instanceToken ,
2022-03-29 23:17:54 +00:00
'Accept-Language' : 'en-US,en;' , // somehow seems essential for some MG sites
2020-05-14 02:26:05 +00:00
} ,
} ) ;
if ( res . statusCode === 200 ) {
2021-11-20 22:59:15 +00:00
const actorData = res . body . result . find ( ( actor ) => actor . name . toLowerCase ( ) === actorName . toLowerCase ( ) ) ;
2020-05-14 02:26:05 +00:00
if ( actorData ) {
const actorReleasesUrl = ` https://site-api.project1service.com/v2/releases?actorId= ${ actorData . id } &limit=100&offset=0&orderBy=-dateReleased&type=scene ` ;
2022-05-29 22:05:33 +00:00
const actorReleasesRes = include . includeActorScenes && await http . get ( actorReleasesUrl , {
session ,
interval : parameters . interval ,
concurrency : parameters . concurrency ,
headers : {
Instance : instanceToken ,
} ,
} ) ;
if ( actorReleasesRes . statusCode === 200 && actorReleasesRes . body . result ) {
2023-11-30 02:12:47 +00:00
return scrapeProfile ( actorData , entity . slug , actorReleasesRes . body . result ) ;
2020-05-14 02:26:05 +00:00
}
2023-11-30 02:12:47 +00:00
return scrapeProfile ( actorData , entity . slug , [ ] ) ;
2020-05-14 02:26:05 +00:00
}
}
return null ;
2020-01-14 03:50:42 +00:00
}
module . exports = {
2022-01-19 23:54:10 +00:00
beforeNetwork : getSession ,
2021-10-27 15:19:23 +00:00
beforeFetchScenes : getSession ,
2022-02-11 21:14:44 +00:00
requireBeforeNetwork : false ,
2020-05-14 02:26:05 +00:00
scrapeLatestX ,
fetchLatest ,
2020-08-24 03:13:34 +00:00
fetchUpcoming ,
2022-03-04 22:31:59 +00:00
fetchScene : fetchRelease ,
fetchMovie : fetchRelease ,
2020-05-14 02:26:05 +00:00
fetchProfile ,
2020-01-14 03:50:42 +00:00
} ;