2019-03-04 01:46:33 +00:00
'use strict' ;
const bhttp = require ( 'bhttp' ) ;
2020-02-01 00:15:40 +00:00
const { fetchLatest , fetchUpcoming , scrapeScene , fetchProfile } = require ( './gamma' ) ;
2019-10-29 02:13:56 +00:00
2020-02-01 00:15:40 +00:00
async function fetchScene ( url , site ) {
const res = await bhttp . get ( url ) ;
2019-03-24 00:29:22 +00:00
2020-02-01 00:15:40 +00:00
const release = await scrapeScene ( res . body . toString ( ) , url , site ) ;
2019-03-24 00:29:22 +00:00
2020-02-01 00:15:40 +00:00
const siteDomain = release . $ ( 'meta[name="twitter:domain"]' ) . attr ( 'content' ) || 'allblackx.com' ; // only AllBlackX has no twitter domain, no other useful hints available
2019-11-30 04:55:32 +00:00
const siteSlug = siteDomain && siteDomain . split ( '.' ) [ 0 ] . toLowerCase ( ) ;
2020-02-01 00:15:40 +00:00
// const siteUrl = siteDomain && `https://www.${siteDomain}`;
2019-04-07 18:51:14 +00:00
2020-02-01 00:15:40 +00:00
release . channel = siteSlug ;
2020-02-06 22:15:28 +00:00
release . director = 'Mason' ;
2019-03-04 01:46:33 +00:00
2020-02-01 00:15:40 +00:00
return release ;
2019-11-30 04:55:32 +00:00
}
2020-02-07 00:48:21 +00:00
function getActorReleasesUrl ( actorPath , page = 1 ) {
return ` https://www.xempire.com/en/videos/xempire/latest/ ${ page } /All-Categories/0 ${ actorPath } ` ;
}
2020-03-12 01:19:45 +00:00
async function networkFetchProfile ( actorName , scraperSlug , site , include ) {
return fetchProfile ( actorName , scraperSlug , null , getActorReleasesUrl , include ) ;
2020-02-07 00:48:21 +00:00
}
2019-03-23 21:48:39 +00:00
module . exports = {
fetchLatest ,
2020-02-07 00:48:21 +00:00
fetchProfile : networkFetchProfile ,
2019-03-23 21:48:39 +00:00
fetchUpcoming ,
fetchScene ,
} ;