Compare commits

..

No commits in common. "c59f05a2f891bd28026fdab09accee783c21ea49" and "70795a69c837f788c2bbaba5e7debbc693d9e6ab" have entirely different histories.

4 changed files with 12 additions and 12 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "traxxx", "name": "traxxx",
"version": "1.151.3", "version": "1.151.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "traxxx", "name": "traxxx",
"version": "1.151.3", "version": "1.151.2",
"description": "All the latest porn releases in one place", "description": "All the latest porn releases in one place",
"main": "src/app.js", "main": "src/app.js",
"scripts": { "scripts": {

View File

@ -117,7 +117,7 @@ async function fetchLatest(site, page) {
} }
async function fetchScene(url, site) { async function fetchScene(url, site) {
const res = await get(url, '.trailer'); const res = await get(url, '.page-content .row');
if (res.ok) { if (res.ok) {
return scrapeScene(res.item, url, site); return scrapeScene(res.item, url, site);

View File

@ -408,12 +408,8 @@ const quFuncs = {
videos, videos,
}; };
function init(context, selector, window) { function init(element, window) {
if (!context) { if (!element) return null;
return null;
}
const element = selector ? context.querySelector(selector) : context;
const legacyContextFuncs = Object.entries(legacyFuncs) // dynamically attach methods with context const legacyContextFuncs = Object.entries(legacyFuncs) // dynamically attach methods with context
.reduce((acc, [key, func]) => ({ .reduce((acc, [key, func]) => ({
@ -448,17 +444,21 @@ function init(context, selector, window) {
function initAll(context, selector, window) { function initAll(context, selector, window) {
if (Array.isArray(context)) { if (Array.isArray(context)) {
return context.map(element => init(element, null, window)); return context.map(element => init(element, window));
} }
return Array.from(context.querySelectorAll(selector)) return Array.from(context.querySelectorAll(selector))
.map(element => init(element, null, window)); .map(element => init(element, window));
} }
function extract(htmlValue, selector, options) { function extract(htmlValue, selector, options) {
const { window } = new JSDOM(htmlValue, { virtualConsole, ...options }); const { window } = new JSDOM(htmlValue, { virtualConsole, ...options });
return init(window.document, selector, window); if (selector) {
return init(window.document.querySelector(selector), window);
}
return init(window.document, window);
} }
function extractAll(htmlValue, selector, options) { function extractAll(htmlValue, selector, options) {