Compare commits

...

3 Commits

Author SHA1 Message Date
DebaucheryLibrarian 2539e88f47 1.201.6 2021-11-22 02:51:55 +01:00
DebaucheryLibrarian 20d0d860d3 Fixed MindGeek scraper trying to acquire session from mindgeek.com 2021-11-22 02:51:52 +01:00
DebaucheryLibrarian 6b4aa64d74 Improved MindGeek scraper session check to prevent crash when network session isn't available yet. 2021-11-22 02:44:03 +01:00
4 changed files with 10 additions and 5 deletions

View File

@ -321,6 +321,7 @@ export default {
} }
.row { .row {
max-width: 100%;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "traxxx", "name": "traxxx",
"version": "1.201.5", "version": "1.201.6",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "traxxx", "name": "traxxx",
"version": "1.201.5", "version": "1.201.6",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@casl/ability": "^5.2.2", "@casl/ability": "^5.2.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "traxxx", "name": "traxxx",
"version": "1.201.5", "version": "1.201.6",
"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

@ -156,10 +156,14 @@ function getUrl(site) {
} }
async function getSession(site, parameters) { async function getSession(site, parameters) {
if (site.slug === 'mindgeek') {
// most MG sites have a parent network to acquire a session from, don't try to acquire session from mindgeek.com for independent channels
return null;
}
const cookieJar = new CookieJar(); const cookieJar = new CookieJar();
const session = http.session({ cookieJar }); const session = http.session({ cookieJar });
// const res = await session.get(url);
const sessionUrl = site.parameters?.siteId && !(site.parameters?.native || site.parameters?.childSession || site.parent?.parameters?.childSession) const sessionUrl = site.parameters?.siteId && !(site.parameters?.native || site.parameters?.childSession || site.parent?.parameters?.childSession)
? site.parent.url ? site.parent.url
: site.url; : site.url;
@ -234,7 +238,7 @@ async function fetchLatest(site, page = 1, options) {
const { searchParams } = new URL(url); const { searchParams } = new URL(url);
const siteId = searchParams.get('site'); const siteId = searchParams.get('site');
const { session, instanceToken } = options.beforeNetwork || await getSession(site, options.parameters); const { session, instanceToken } = options.beforeNetwork?.headers?.Instance ? options.beforeNetwork : await getSession(site, options.parameters);
const beforeDate = moment().add('1', 'day').format('YYYY-MM-DD'); const beforeDate = moment().add('1', 'day').format('YYYY-MM-DD');
const limit = 24; const limit = 24;