Fixed title curation disparity Tokyo Hot.

This commit is contained in:
DebaucheryLibrarian 2023-08-02 02:22:26 +02:00
parent 1408074ef4
commit c064efc812
1 changed files with 6 additions and 2 deletions

View File

@ -4,6 +4,10 @@ const unprint = require('unprint');
const slugify = require('../utils/slugify');
function curateTitle(title) {
return title?.replace(/^tokyo hot\s*/i, '');
}
function scrapeAll(scenes, channel) {
return scenes.map(({ query }) => {
const release = {};
@ -14,7 +18,7 @@ function scrapeAll(scenes, channel) {
release.entryId = pathname.match(/product\/(\w+)/)?.[1];
release.shootId = query.attribute('img', 'title');
release.title = query.content('.title')?.replace(/^tokyo hot\s*/i, '');
release.title = curateTitle(query.content('.title'));
release.description = query.content('.text');
const poster = query.img();
@ -36,7 +40,7 @@ function scrapeScene({ query }, url, channel) {
release.entryId = new URL(url).pathname.match(/product\/(\w+)/)?.[1];
release.shootId = query.content('//dt[contains(text(), "Product ID")]/following-sibling::dd[1]');
release.title = query.content('.contents h2');
release.title = curateTitle(query.content('.contents h2'));
release.description = query.content('.contents .sentence');
release.date = query.date('//dt[contains(text(), "Release Date")]/following-sibling::dd[1]', 'YYYY/MM/DD');
release.duration = query.duration('//dt[contains(text(), "Duration")]/following-sibling::dd[1]');