diff --git a/assets/components/releases/details.vue b/assets/components/releases/details.vue
index 561e481c..090ee0e5 100644
--- a/assets/components/releases/details.vue
+++ b/assets/components/releases/details.vue
@@ -21,7 +21,7 @@
-
+
child.type === 'trailer')?.videos.full?.files;
+
+ const teaser = teaserSources && Object.values(teaserSources).map(source => ({
+ src: source.urls.view,
+ quality: parseInt(source.format, 10),
+ }));
+
+ const trailer = trailerSources && Object.values(trailerSources).map(source => ({
+ src: source.urls.view,
+ quality: parseInt(source.format, 10),
+ }));
+
+ return { teaser, trailer };
+}
+
+function scrapeLatestX(data, site, filterChannel) {
if (site.parameters?.extract === true && data.collections.length > 0) {
// release should not belong to any channel
return null;
@@ -36,15 +53,22 @@ function scrapeLatestX(data, site) {
return null;
}
+ if (filterChannel && !data.collections?.some(collection => collection.id === site.parameters?.siteId)) {
+ // used to separate upcoming Brazzers scenes
+ return null;
+ }
+
const release = {
entryId: data.id,
title: data.title,
description: data.description,
};
- const hostname = site.parameters?.native ? site.url : site.parent.url;
+ const basepath = site.parameters?.scene
+ || (site.parameters?.native && `${site.url}/scene`)
+ || `${site.parent.url}/scene`;
- release.url = `${hostname}/scene/${release.entryId}/`;
+ release.url = `${basepath}/${release.entryId}/`;
release.date = new Date(data.dateReleased);
release.actors = data.actors.map(actor => ({ name: actor.name, gender: actor.gender }));
@@ -53,20 +77,16 @@ function scrapeLatestX(data, site) {
release.duration = data.videos.mediabook?.length;
[release.poster, ...release.photos] = getThumbs(data);
- const teaserSources = data.videos.mediabook?.files;
+ const { teaser, trailer } = getVideos(data);
- if (teaserSources) {
- release.teaser = Object.values(teaserSources).map(teaser => ({
- src: teaser.urls.view,
- quality: parseInt(teaser.format, 10),
- }));
- }
+ if (teaser) release.teaser = teaser;
+ if (trailer) release.trailer = trailer;
return release;
}
-async function scrapeLatest(items, site) {
- const latestReleases = await Promise.all(items.map(async data => scrapeLatestX(data, site)));
+async function scrapeLatest(items, site, filterChannel) {
+ const latestReleases = await Promise.all(items.map(async data => scrapeLatestX(data, site, filterChannel)));
return latestReleases.filter(Boolean);
}
@@ -87,14 +107,10 @@ function scrapeScene(data, url, _site, networkName) {
[release.poster, ...release.photos] = getThumbs(data);
- const teaserSources = data.videos.mediabook?.files;
+ const { teaser, trailer } = getVideos(data);
- if (teaserSources) {
- release.teaser = Object.values(teaserSources).map(teaser => ({
- src: teaser.urls.view,
- quality: parseInt(teaser.format, 10),
- }));
- }
+ if (teaser) release.teaser = teaser;
+ if (trailer) release.trailer = trailer;
const siteName = data.collections[0]?.name || data.brand;
release.channel = slugify(siteName, '');
@@ -204,6 +220,27 @@ async function fetchLatest(site, page = 1) {
return null;
}
+async function fetchUpcoming(site) {
+ const url = getUrl(site);
+ const { session, instanceToken } = await getSession(url);
+
+ const apiUrl = 'https://site-api.project1service.com/v2/upcoming-releases';
+
+ const res = await session.get(apiUrl, {
+ headers: {
+ Instance: instanceToken,
+ Origin: site.url,
+ Referer: url,
+ },
+ });
+
+ if (res.statusCode === 200 && res.body.result) {
+ return scrapeLatest(res.body.result, site, true);
+ }
+
+ return null;
+}
+
async function fetchScene(url, site) {
const entryId = url.match(/\d+/)[0];
const { session, instanceToken } = await getSession(url);
@@ -263,6 +300,7 @@ async function fetchProfile({ name: actorName }, networkSlug, actorPath = 'model
module.exports = {
scrapeLatestX,
fetchLatest,
+ fetchUpcoming,
fetchScene,
fetchProfile,
};
diff --git a/src/scrapers/scrapers.js b/src/scrapers/scrapers.js
index a1a0ec5c..ba748fa2 100644
--- a/src/scrapers/scrapers.js
+++ b/src/scrapers/scrapers.js
@@ -9,7 +9,6 @@ const bamvisions = require('./bamvisions');
const bang = require('./bang');
const bangbros = require('./bangbros');
const blowpass = require('./blowpass');
-const brazzers = require('./brazzers');
const burningangel = require('./burningangel');
const cherrypimps = require('./cherrypimps');
const ddfnetwork = require('./ddfnetwork');
@@ -87,7 +86,7 @@ module.exports = {
bang,
bangbros,
blowpass,
- brazzers,
+ brazzers: mindgeek,
burningangel,
cherrypimps,
pornworld: ddfnetwork,
@@ -170,7 +169,7 @@ module.exports = {
blowpass,
boobpedia,
brattysis: nubiles,
- brazzers,
+ brazzers: mindgeek,
burningangel,
cherrypimps,
pornworld: ddfnetwork,
diff --git a/src/store-releases.js b/src/store-releases.js
index 7474fa58..8475431a 100644
--- a/src/store-releases.js
+++ b/src/store-releases.js
@@ -307,6 +307,7 @@ async function storeScenes(releases) {
const [actors] = await Promise.all([
associateActors(releasesWithId, batchId),
associateReleaseTags(releasesWithId),
+ storeClips(releasesWithId),
]);
await updateReleasesSearch(releasesWithId.map(release => release.id));
@@ -318,8 +319,6 @@ async function storeScenes(releases) {
await scrapeActors(actors.map(actor => actor.name));
}
- await storeClips(releasesWithId);
-
logger.info(`Stored ${storedReleaseEntries.length} releases`);
return releasesWithId;