Compare commits

..

2 Commits

Author SHA1 Message Date
DebaucheryLibrarian 03d96d4dec 1.206.5 2022-02-07 22:29:11 +01:00
DebaucheryLibrarian 1dfa034332 Handling 'page not found' with 200 OK in Gamma scraper. 2022-02-07 22:29:09 +01:00
3 changed files with 17 additions and 5 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "traxxx", "name": "traxxx",
"version": "1.206.4", "version": "1.206.5",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "traxxx", "name": "traxxx",
"version": "1.206.4", "version": "1.206.5",
"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.206.4", "version": "1.206.5",
"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

@ -500,6 +500,10 @@ async function scrapeMovie({ query, el }, url, entity, baseRelease, options) {
const rawData = dataLayer?.[0]?.dvdDetails; 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
if (query.exists('.NotFound-Title')) {
return null;
}
release.entryId = new URL(url).pathname.match(/\/(\d+)(\/|$)/)?.[1]; release.entryId = new URL(url).pathname.match(/\/(\d+)(\/|$)/)?.[1];
release.covers = [ release.covers = [
@ -674,10 +678,14 @@ async function fetchSceneApi(url, site, baseRelease, options) {
encodeJSON: true, encodeJSON: true,
}); });
if (res.status === 200 && res.body.results?.[0]?.hits) { if (res.status === 200 && res.body.results?.[0]?.hits.length > 0) {
return scrapeReleaseApi(res.body.results[0].hits[0], site, options); return scrapeReleaseApi(res.body.results[0].hits[0], site, options);
} }
if (res.status === 200) {
return null;
}
return res.status; return res.status;
} }
@ -706,10 +714,14 @@ async function fetchMovieApi(url, site, baseRelease, options) {
encodeJSON: true, encodeJSON: true,
}); });
if (res.status === 200 && res.body.results?.[0]?.hits) { if (res.status === 200 && res.body.results?.[0]?.hits.length > 0) {
return scrapeReleaseApi(res.body.results[0].hits[0], site, options); return scrapeReleaseApi(res.body.results[0].hits[0], site, options);
} }
if (res.status === 200) {
return null;
}
return res.status; return res.status;
} }