forked from DebaucheryLibrarian/traxxx
Added mimetype check to teasers and trailers. Added chapters to MindGeek scraper, fixed scene ID extraction getting stuck on numbers in domain name. Ordering chapters by timestamp.
This commit is contained in:
@@ -84,6 +84,12 @@ function scrapeLatestX(data, site, filterChannel) {
|
||||
if (teaser) release.teaser = teaser;
|
||||
if (trailer) release.trailer = trailer;
|
||||
|
||||
release.chapters = data.timeTags?.map(chapter => ({
|
||||
time: chapter.startTime,
|
||||
duration: chapter.endTime - chapter.startTime,
|
||||
tags: [chapter.name],
|
||||
}));
|
||||
|
||||
return release;
|
||||
}
|
||||
|
||||
@@ -114,6 +120,12 @@ function scrapeScene(data, url, _site, networkName) {
|
||||
if (teaser) release.teaser = teaser;
|
||||
if (trailer) release.trailer = trailer;
|
||||
|
||||
release.chapters = data.timeTags?.map(chapter => ({
|
||||
time: chapter.startTime,
|
||||
duration: chapter.endTime - chapter.startTime,
|
||||
tags: [chapter.name],
|
||||
}));
|
||||
|
||||
const siteName = data.collections[0]?.name || data.brand;
|
||||
release.channel = slugify(siteName, '');
|
||||
|
||||
@@ -279,7 +291,7 @@ async function fetchScene(url, site, baseScene, options) {
|
||||
return baseScene;
|
||||
}
|
||||
|
||||
const entryId = url.match(/\d+/)[0];
|
||||
const entryId = new URL(url).pathname.match(/\/(\d+)/)?.[1];
|
||||
const { session, instanceToken } = await getSession(site, options.parameters);
|
||||
|
||||
const res = await http.get(`https://site-api.project1service.com/v2/releases/${entryId}`, {
|
||||
|
||||
Reference in New Issue
Block a user