35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
const { fetchLatest, fetchUpcoming, scrapeScene, fetchProfile } = require('./gamma');
|
|
const http = require('../utils/http');
|
|
|
|
async function fetchScene(url, site, baseRelease, options) {
|
|
const res = await http.get(url);
|
|
|
|
const release = await scrapeScene(res.body.toString(), url, site, baseRelease, null, options);
|
|
|
|
const siteDomain = release.$('meta[name="twitter:domain"]').attr('content') || 'allblackx.com'; // only AllBlackX has no twitter domain, no other useful hints available
|
|
const siteSlug = siteDomain && siteDomain.split('.')[0].toLowerCase();
|
|
// const siteUrl = siteDomain && `https://www.${siteDomain}`;
|
|
|
|
release.channel = siteSlug;
|
|
release.director = 'Mason';
|
|
|
|
return release;
|
|
}
|
|
|
|
function getActorReleasesUrl(actorPath, page = 1) {
|
|
return `https://www.xempire.com/en/videos/xempire/latest/${page}/All-Categories/0${actorPath}`;
|
|
}
|
|
|
|
async function networkFetchProfile(baseActor, context, include) {
|
|
return fetchProfile(baseActor, context, null, getActorReleasesUrl, include);
|
|
}
|
|
|
|
module.exports = {
|
|
fetchLatest,
|
|
fetchProfile: networkFetchProfile,
|
|
fetchUpcoming,
|
|
fetchScene,
|
|
};
|