Refactored clips into chapters.

This commit is contained in:
DebaucheryLibrarian
2021-02-27 00:37:22 +01:00
parent 0eba0461c9
commit bb20659934
115 changed files with 671 additions and 194 deletions

View File

@@ -172,7 +172,7 @@ async function scrapeScene({ query, html }, url, channel) {
release.poster = qu.prefixUrl(html.match(/background-image: url\('(.*)'\)/)?.[1], channel.url);
release.clips = query.all('.ClipOuter').map((el) => {
release.chapters = query.all('.ClipOuter').map((el) => {
const chapter = {};
chapter.title = query.text(el, 'h4');

View File

@@ -213,6 +213,11 @@ async function scrapeScene(data, url, site, baseRelease) {
const trailer = await getTrailer(scene, site, url);
if (trailer) release.trailer = trailer;
release.chapters = data.video.chapters?.video.map(chapter => ({
tags: [chapter.title],
time: chapter.seconds,
}));
return release;
}