forked from DebaucheryLibrarian/traxxx
Fixed title curation disparity Tokyo Hot.
This commit is contained in:
parent
1408074ef4
commit
c064efc812
|
@ -4,6 +4,10 @@ const unprint = require('unprint');
|
||||||
|
|
||||||
const slugify = require('../utils/slugify');
|
const slugify = require('../utils/slugify');
|
||||||
|
|
||||||
|
function curateTitle(title) {
|
||||||
|
return title?.replace(/^tokyo hot\s*/i, '');
|
||||||
|
}
|
||||||
|
|
||||||
function scrapeAll(scenes, channel) {
|
function scrapeAll(scenes, channel) {
|
||||||
return scenes.map(({ query }) => {
|
return scenes.map(({ query }) => {
|
||||||
const release = {};
|
const release = {};
|
||||||
|
@ -14,7 +18,7 @@ function scrapeAll(scenes, channel) {
|
||||||
release.entryId = pathname.match(/product\/(\w+)/)?.[1];
|
release.entryId = pathname.match(/product\/(\w+)/)?.[1];
|
||||||
release.shootId = query.attribute('img', 'title');
|
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');
|
release.description = query.content('.text');
|
||||||
|
|
||||||
const poster = query.img();
|
const poster = query.img();
|
||||||
|
@ -36,7 +40,7 @@ function scrapeScene({ query }, url, channel) {
|
||||||
release.entryId = new URL(url).pathname.match(/product\/(\w+)/)?.[1];
|
release.entryId = new URL(url).pathname.match(/product\/(\w+)/)?.[1];
|
||||||
release.shootId = query.content('//dt[contains(text(), "Product ID")]/following-sibling::dd[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.description = query.content('.contents .sentence');
|
||||||
release.date = query.date('//dt[contains(text(), "Release Date")]/following-sibling::dd[1]', 'YYYY/MM/DD');
|
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]');
|
release.duration = query.duration('//dt[contains(text(), "Duration")]/following-sibling::dd[1]');
|
||||||
|
|
Loading…
Reference in New Issue