Fixed Porn Doe's poster query. Checking style attribute existence in qu before attempting to use it.

This commit is contained in:
DebaucheryLibrarian 2020-09-17 00:35:41 +02:00
parent 718abdfdba
commit 0190ee9531
2 changed files with 5 additions and 3 deletions

View File

@ -10,12 +10,14 @@ function scrapeAll(scenes) {
release.url = query.url('a');
release.entryId = release.url.match(/\/watch\/(\d+)/)[1];
release.title = query.q('.bottom h4', true);
release.title = query.cnt('.bottom .h4') || query.q('.bottom .link', 'title');
release.date = query.date('.extra-info:not(.actors)', 'DD MMMM YYYY');
release.actors = query.all('.actors a strong', true);
const poster = query.img('.thumb img');
// const poster = query.img('.thumb img');
const poster = query.img('.thumb', 'data-bg');
release.poster = [
poster.replace('512x288', '1472x828'),
poster,

View File

@ -141,7 +141,7 @@ function removeStyleFunctionSpaces(el) {
function style(context, selector, styleAttr) {
const el = q(context, selector);
if (el) {
if (el?.hasAttribute('style')) {
removeStyleFunctionSpaces(el);
return styleAttr ? el.style[styleAttr] : el.style;