Compare commits
No commits in common. "d93670842bdd7b137e9d15054ca62239a139db5e" and "5f89c6e14c88f82d194c2bf339b7c1a7647295e8" have entirely different histories.
d93670842b
...
5f89c6e14c
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.204.0",
|
"version": "1.203.13",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.204.0",
|
"version": "1.203.13",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@casl/ability": "^5.2.2",
|
"@casl/ability": "^5.2.2",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.204.0",
|
"version": "1.203.13",
|
||||||
"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": {
|
||||||
|
|
|
@ -463,9 +463,7 @@ async function fetchMovieTrailer(release) {
|
||||||
|
|
||||||
async function scrapeMovie({ query, el }, window, url, entity, options) {
|
async function scrapeMovie({ query, el }, window, url, entity, options) {
|
||||||
const release = {};
|
const release = {};
|
||||||
|
const rawData = window.dataLayer[0]?.dvdDetails;
|
||||||
const { dataLayer } = query.exec('//script[contains(text(), "dataLayer")]', ['dataLayer']);
|
|
||||||
const rawData = dataLayer?.[0]?.dvdDetails;
|
|
||||||
const data = rawData.dvdId && rawData; // dvdDetails is mostly empty in some cache states
|
const data = rawData.dvdId && rawData; // dvdDetails is mostly empty in some cache states
|
||||||
|
|
||||||
release.entryId = new URL(url).pathname.match(/\/(\d+)(\/|$)/)?.[1];
|
release.entryId = new URL(url).pathname.match(/\/(\d+)(\/|$)/)?.[1];
|
||||||
|
@ -752,7 +750,11 @@ async function fetchScene(url, site, baseRelease, options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchMovie(url, channel, baseRelease, options) {
|
async function fetchMovie(url, channel, baseRelease, options) {
|
||||||
const res = await qu.get(url, null, null);
|
const res = await qu.get(url, null, null, {
|
||||||
|
extract: {
|
||||||
|
runScripts: 'dangerously',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
return scrapeMovie(res.item, res.window, url, channel, options);
|
return scrapeMovie(res.item, res.window, url, channel, options);
|
||||||
|
|
|
@ -84,69 +84,32 @@ function prefixUrl(urlValue, origin, protocol = 'https') {
|
||||||
return urlValue;
|
return urlValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
function iterateXPathResult(iterator, results = []) {
|
|
||||||
const element = iterator.iterateNext();
|
|
||||||
|
|
||||||
if (element) {
|
|
||||||
return iterateXPathResult(iterator, [...results, element]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return results;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getElements(context, selector, first = false) {
|
|
||||||
if (!selector) {
|
|
||||||
return context;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (/^\/\//.test(selector)) {
|
|
||||||
// XPath selector
|
|
||||||
const iterator = globalWindow.document.evaluate(selector, context, null, globalWindow.XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
|
|
||||||
|
|
||||||
if (first) {
|
|
||||||
return iterator.iterateNext();
|
|
||||||
}
|
|
||||||
|
|
||||||
return iterateXPathResult(iterator);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (first) {
|
|
||||||
return context.querySelector(selector);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Array.from(context.querySelectorAll(selector));
|
|
||||||
}
|
|
||||||
|
|
||||||
function q(context, selector, attrArg, applyTrim = true) {
|
function q(context, selector, attrArg, applyTrim = true) {
|
||||||
if (!selector && context.nodeName === '#document') {
|
if (!selector && context.nodeName === '#document') {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const attr = attrArg === true ? 'textContent' : attrArg;
|
const attr = attrArg === true ? 'textContent' : attrArg;
|
||||||
const element = getElements(context, selector, true);
|
|
||||||
|
|
||||||
if (!element) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attr) {
|
if (attr) {
|
||||||
const value = element[attr] || element.getAttribute(attr);
|
const value = selector
|
||||||
|
? context.querySelector(selector)?.[attr] || context.querySelector(selector)?.attributes[attr]?.value
|
||||||
|
: context[attr] || context.getAttribute(attr);
|
||||||
|
|
||||||
return applyTrim && typeof value === 'string' ? trim(value) : value;
|
return applyTrim && typeof value === 'string' ? trim(value) : value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return element;
|
return selector ? context.querySelector(selector) : context;
|
||||||
}
|
}
|
||||||
|
|
||||||
function all(context, selector, attrArg, applyTrim = true) {
|
function all(context, selector, attrArg, applyTrim = true) {
|
||||||
const attr = attrArg === true ? 'textContent' : attrArg;
|
const attr = attrArg === true ? 'textContent' : attrArg;
|
||||||
const elements = getElements(context, selector);
|
|
||||||
|
|
||||||
if (attr) {
|
if (attr) {
|
||||||
return elements.map((el) => q(el, null, attr, applyTrim));
|
return Array.from(context.querySelectorAll(selector), (el) => q(el, null, attr, applyTrim));
|
||||||
}
|
}
|
||||||
|
|
||||||
return elements;
|
return Array.from(context.querySelectorAll(selector));
|
||||||
}
|
}
|
||||||
|
|
||||||
function exists(context, selector) {
|
function exists(context, selector) {
|
||||||
|
@ -171,42 +134,6 @@ function html(context, selector) {
|
||||||
return el && el.innerHTML;
|
return el && el.innerHTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
function htmls(context, selector) {
|
|
||||||
const els = all(context, selector, null, true);
|
|
||||||
|
|
||||||
return els.map((el) => el.innerHTML);
|
|
||||||
}
|
|
||||||
|
|
||||||
function execute(context, selector = 'script') {
|
|
||||||
const scripts = htmls(context, selector);
|
|
||||||
const originalGlobal = Object.fromEntries(Object.entries(global));
|
|
||||||
|
|
||||||
const errors = scripts?.reduce((accErrors, script) => {
|
|
||||||
try {
|
|
||||||
Function(script)(); /* eslint-disable-line no-new-func */
|
|
||||||
|
|
||||||
return accErrors;
|
|
||||||
} catch (error) {
|
|
||||||
// the script failed
|
|
||||||
return [...accErrors, error];
|
|
||||||
}
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const data = Object.fromEntries(Object.entries(global).filter(([key, value]) => {
|
|
||||||
if (originalGlobal[key] !== value) {
|
|
||||||
delete global[key];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}));
|
|
||||||
|
|
||||||
return {
|
|
||||||
...data,
|
|
||||||
errors,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function json(context, selector) {
|
function json(context, selector) {
|
||||||
const el = q(context, selector, null, true);
|
const el = q(context, selector, null, true);
|
||||||
|
|
||||||
|
@ -229,6 +156,12 @@ function jsons(context, selector) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function htmls(context, selector) {
|
||||||
|
const els = all(context, selector, null, true);
|
||||||
|
|
||||||
|
return els.map((el) => el.innerHTML);
|
||||||
|
}
|
||||||
|
|
||||||
function texts(context, selector, applyTrim = true, filter = true) {
|
function texts(context, selector, applyTrim = true, filter = true) {
|
||||||
const el = q(context, selector, null, applyTrim);
|
const el = q(context, selector, null, applyTrim);
|
||||||
if (!el) return null;
|
if (!el) return null;
|
||||||
|
@ -496,8 +429,6 @@ const quFuncs = {
|
||||||
duration,
|
duration,
|
||||||
el: q,
|
el: q,
|
||||||
element: q,
|
element: q,
|
||||||
execute,
|
|
||||||
exec: execute,
|
|
||||||
exists,
|
exists,
|
||||||
html,
|
html,
|
||||||
htmls,
|
htmls,
|
||||||
|
|
Loading…
Reference in New Issue