Fixed Aylo scraper using spartan ID in URLs; should only be used for unique identifier.

This commit is contained in:
DebaucheryLibrarian 2024-11-19 04:05:17 +01:00
parent 65dedc80ed
commit 844c1d87a6
1 changed files with 3 additions and 3 deletions

View File

@ -81,7 +81,7 @@ function scrapeLatestX(data, site, filterChannel, options) {
const basepath = getBasePath(site);
release.url = `${basepath}/${release.entryId}/${slugify(release.title)}`;
release.url = `${basepath}/${data.id}/${slugify(release.title)}`; // spartanId doesn't work in URLs
release.date = new Date(data.dateReleased);
release.duration = data.videos.mediabook?.length > 1 ? data.videos.mediabook.length : null;
@ -128,7 +128,7 @@ async function scrapeLatest(items, site, filterChannel, options) {
function scrapeRelease(data, url, channel, networkName, options) {
const release = {};
const { id: entryId, title, description } = data;
const { title, description } = data;
release.entryId = (options?.parameters.preferSpartanId && data.spartanId) || data.id;
release.title = title;
@ -156,7 +156,7 @@ function scrapeRelease(data, url, channel, networkName, options) {
const siteName = data.collections[0]?.name || data.brand;
release.channel = slugify(siteName, '');
release.url = url || `https://www.${networkName || data.brand}.com/scene/${entryId}/`;
release.url = url || `https://www.${networkName || data.brand}.com/scene/${data.id}/`; // spartanId is invalid in URLs
if (data.parent?.type === 'movie' || data.parent?.type === 'serie') {
release[data.parent.type] = {