Compare commits
2 Commits
70795a69c8
...
c59f05a2f8
Author | SHA1 | Date |
---|---|---|
|
c59f05a2f8 | |
|
8739ec08cf |
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "traxxx",
|
||||
"version": "1.151.2",
|
||||
"version": "1.151.3",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "traxxx",
|
||||
"version": "1.151.2",
|
||||
"version": "1.151.3",
|
||||
"description": "All the latest porn releases in one place",
|
||||
"main": "src/app.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -117,7 +117,7 @@ async function fetchLatest(site, page) {
|
|||
}
|
||||
|
||||
async function fetchScene(url, site) {
|
||||
const res = await get(url, '.page-content .row');
|
||||
const res = await get(url, '.trailer');
|
||||
|
||||
if (res.ok) {
|
||||
return scrapeScene(res.item, url, site);
|
||||
|
|
|
@ -408,8 +408,12 @@ const quFuncs = {
|
|||
videos,
|
||||
};
|
||||
|
||||
function init(element, window) {
|
||||
if (!element) return null;
|
||||
function init(context, selector, window) {
|
||||
if (!context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const element = selector ? context.querySelector(selector) : context;
|
||||
|
||||
const legacyContextFuncs = Object.entries(legacyFuncs) // dynamically attach methods with context
|
||||
.reduce((acc, [key, func]) => ({
|
||||
|
@ -444,21 +448,17 @@ function init(element, window) {
|
|||
|
||||
function initAll(context, selector, window) {
|
||||
if (Array.isArray(context)) {
|
||||
return context.map(element => init(element, window));
|
||||
return context.map(element => init(element, null, window));
|
||||
}
|
||||
|
||||
return Array.from(context.querySelectorAll(selector))
|
||||
.map(element => init(element, window));
|
||||
.map(element => init(element, null, window));
|
||||
}
|
||||
|
||||
function extract(htmlValue, selector, options) {
|
||||
const { window } = new JSDOM(htmlValue, { virtualConsole, ...options });
|
||||
|
||||
if (selector) {
|
||||
return init(window.document.querySelector(selector), window);
|
||||
}
|
||||
|
||||
return init(window.document, window);
|
||||
return init(window.document, selector, window);
|
||||
}
|
||||
|
||||
function extractAll(htmlValue, selector, options) {
|
||||
|
|
Loading…
Reference in New Issue