Compare commits
3 Commits
92f9ff4104
...
e5ad1648eb
Author | SHA1 | Date |
---|---|---|
|
e5ad1648eb | |
|
100a35b4e8 | |
|
6c5d4389fe |
|
@ -361,7 +361,10 @@
|
||||||
:available-actors="actor.actors"
|
:available-actors="actor.actors"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Releases :releases="releases" />
|
<Releases
|
||||||
|
:releases="releases"
|
||||||
|
:done="done"
|
||||||
|
/>
|
||||||
|
|
||||||
<Pagination
|
<Pagination
|
||||||
:items-total="totalCount"
|
:items-total="totalCount"
|
||||||
|
@ -389,6 +392,8 @@ import Social from './social.vue';
|
||||||
import StashButton from '../stashes/button.vue';
|
import StashButton from '../stashes/button.vue';
|
||||||
|
|
||||||
async function fetchActor(scroll = true) {
|
async function fetchActor(scroll = true) {
|
||||||
|
this.done = false;
|
||||||
|
|
||||||
const { actor, releases, totalCount } = await this.$store.dispatch('fetchActorById', {
|
const { actor, releases, totalCount } = await this.$store.dispatch('fetchActorById', {
|
||||||
actorId: Number(this.$route.params.actorId),
|
actorId: Number(this.$route.params.actorId),
|
||||||
limit: this.limit,
|
limit: this.limit,
|
||||||
|
@ -400,6 +405,7 @@ async function fetchActor(scroll = true) {
|
||||||
this.releases = releases;
|
this.releases = releases;
|
||||||
this.totalCount = totalCount;
|
this.totalCount = totalCount;
|
||||||
this.stashedBy = actor.stashes;
|
this.stashedBy = actor.stashes;
|
||||||
|
this.done = true;
|
||||||
|
|
||||||
if (this.$refs.filter && scroll) {
|
if (this.$refs.filter && scroll) {
|
||||||
this.$refs.filter.$el.scrollIntoView();
|
this.$refs.filter.$el.scrollIntoView();
|
||||||
|
@ -463,6 +469,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
actor: null,
|
actor: null,
|
||||||
releases: null,
|
releases: null,
|
||||||
|
done: false,
|
||||||
totalCount: 0,
|
totalCount: 0,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
pageTitle: null,
|
pageTitle: null,
|
||||||
|
|
|
@ -35,11 +35,11 @@
|
||||||
class="button button-primary"
|
class="button button-primary"
|
||||||
>Log in</button>
|
>Log in</button>
|
||||||
|
|
||||||
<router-link
|
<RouterLink
|
||||||
v-if="$store.state.auth.signup"
|
v-if="$store.state.auth.signup"
|
||||||
:to="{ name: 'signup', query: { ref: $route.query.ref } }"
|
:to="{ name: 'signup', query: { ref: $route.query.ref } }"
|
||||||
class="link link-external signup"
|
class="link link-external signup"
|
||||||
>Sign up</router-link>
|
>Sign up</RouterLink>
|
||||||
</template>
|
</template>
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -43,11 +43,11 @@
|
||||||
class="button button-primary"
|
class="button button-primary"
|
||||||
>Sign up</button>
|
>Sign up</button>
|
||||||
|
|
||||||
<router-link
|
<RouterLink
|
||||||
v-if="$store.state.auth.login"
|
v-if="$store.state.auth.login"
|
||||||
:to="{ name: 'login', query: { ref: $route.query.ref } }"
|
:to="{ name: 'login', query: { ref: $route.query.ref } }"
|
||||||
class="link link-external login"
|
class="link link-external login"
|
||||||
>Log in</router-link>
|
>Log in</RouterLink>
|
||||||
</template>
|
</template>
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -111,7 +111,10 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="releases">
|
<div class="releases">
|
||||||
<Releases :releases="entity.releases" />
|
<Releases
|
||||||
|
:releases="entity.releases"
|
||||||
|
:done="done"
|
||||||
|
/>
|
||||||
|
|
||||||
<Pagination
|
<Pagination
|
||||||
:items-total="totalCount"
|
:items-total="totalCount"
|
||||||
|
@ -134,6 +137,7 @@ import Scroll from '../scroll/scroll.vue';
|
||||||
import Campaign from '../campaigns/campaign.vue';
|
import Campaign from '../campaigns/campaign.vue';
|
||||||
|
|
||||||
async function fetchEntity(scroll = true) {
|
async function fetchEntity(scroll = true) {
|
||||||
|
this.done = false;
|
||||||
this.entityUrl = null;
|
this.entityUrl = null;
|
||||||
|
|
||||||
const { entity, totalCount } = await this.$store.dispatch('fetchEntityBySlugAndType', {
|
const { entity, totalCount } = await this.$store.dispatch('fetchEntityBySlugAndType', {
|
||||||
|
@ -158,6 +162,7 @@ async function fetchEntity(scroll = true) {
|
||||||
}).toString();
|
}).toString();
|
||||||
|
|
||||||
this.entityUrl = campaign?.url || campaign?.affiliate?.url || `${entity.url}${campaign?.affiliate?.parameters ? `?${affiliateParams}` : ''}`;
|
this.entityUrl = campaign?.url || campaign?.affiliate?.url || `${entity.url}${campaign?.affiliate?.parameters ? `?${affiliateParams}` : ''}`;
|
||||||
|
this.done = true;
|
||||||
|
|
||||||
if (scroll && this.$refs.filter?.$el) {
|
if (scroll && this.$refs.filter?.$el) {
|
||||||
this.$refs.filter.$el.scrollIntoView();
|
this.$refs.filter.$el.scrollIntoView();
|
||||||
|
@ -189,6 +194,7 @@ export default {
|
||||||
entity: null,
|
entity: null,
|
||||||
pageTitle: null,
|
pageTitle: null,
|
||||||
totalCount: null,
|
totalCount: null,
|
||||||
|
done: false,
|
||||||
limit: Number(this.$route.query.limit) || 20,
|
limit: Number(this.$route.query.limit) || 20,
|
||||||
expanded: false,
|
expanded: false,
|
||||||
entityUrl: null,
|
entityUrl: null,
|
||||||
|
|
|
@ -0,0 +1,90 @@
|
||||||
|
<template>
|
||||||
|
<div class="load-container">
|
||||||
|
<div class="load-ellipsis">
|
||||||
|
<div />
|
||||||
|
<div />
|
||||||
|
<div />
|
||||||
|
<div />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.load-container {
|
||||||
|
display: inline-flex;
|
||||||
|
position: relative;
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load-ellipsis {
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
width: 5rem;
|
||||||
|
height: .75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load-ellipsis div {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
width: .75rem;
|
||||||
|
height: .75rem;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.load-ellipsis div:nth-child(1) {
|
||||||
|
left: .5rem;
|
||||||
|
animation: load-ellipsis1 0.5s infinite linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load-ellipsis div:nth-child(2) {
|
||||||
|
left: .5rem;
|
||||||
|
animation: load-ellipsis2 0.5s infinite linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load-ellipsis div:nth-child(3) {
|
||||||
|
left: 2rem;
|
||||||
|
animation: load-ellipsis3 0.5s infinite linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
.load-ellipsis div:nth-child(4) {
|
||||||
|
left: 3.5rem;
|
||||||
|
animation: load-ellipsis4 0.5s infinite linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes load-ellipsis1 {
|
||||||
|
0% {
|
||||||
|
transform: scale(0);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: scale(0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes load-ellipsis2 {
|
||||||
|
0% {
|
||||||
|
transform: translate(0, 0) scale(0.5);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: translate(1.5rem, 0) scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes load-ellipsis3 {
|
||||||
|
0% {
|
||||||
|
transform: translate(0, 0) scale(1);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: translate(1.5rem, 0) scale(0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes load-ellipsis4 {
|
||||||
|
0% {
|
||||||
|
transform: scale(0.5);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: scale(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -5,8 +5,10 @@
|
||||||
class="heading"
|
class="heading"
|
||||||
><span class="range">{{ range }}</span> releases for '{{ context }}'</h3>
|
><span class="range">{{ range }}</span> releases for '{{ context }}'</h3>
|
||||||
|
|
||||||
|
<Ellipsis v-if="!done" />
|
||||||
|
|
||||||
<ul
|
<ul
|
||||||
v-if="releases.length > 0"
|
v-else-if="releases.length > 0"
|
||||||
:key="sfw"
|
:key="sfw"
|
||||||
class="nolist tiles"
|
class="nolist tiles"
|
||||||
>
|
>
|
||||||
|
@ -25,7 +27,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
v-if="releases.length === 0 && range !== 'all'"
|
v-else-if="releases.length === 0 && range !== 'all'"
|
||||||
class="empty"
|
class="empty"
|
||||||
>No {{ range }} releases</span>
|
>No {{ range }} releases</span>
|
||||||
|
|
||||||
|
@ -37,6 +39,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Ellipsis from '../loading/ellipsis.vue';
|
||||||
import SceneTile from './scene-tile.vue';
|
import SceneTile from './scene-tile.vue';
|
||||||
|
|
||||||
function range() {
|
function range() {
|
||||||
|
@ -49,6 +52,7 @@ function sfw() {
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
Ellipsis,
|
||||||
SceneTile,
|
SceneTile,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
@ -60,6 +64,10 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
done: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
referer: {
|
referer: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null,
|
default: null,
|
||||||
|
|
|
@ -64,7 +64,10 @@
|
||||||
:fetch-releases="fetchReleases"
|
:fetch-releases="fetchReleases"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Releases :releases="releases" />
|
<Releases
|
||||||
|
:releases="releases"
|
||||||
|
:done="done"
|
||||||
|
/>
|
||||||
|
|
||||||
<Pagination
|
<Pagination
|
||||||
:items-total="totalCount"
|
:items-total="totalCount"
|
||||||
|
@ -93,6 +96,8 @@ import Campaign from '../campaigns/campaign.vue';
|
||||||
const converter = new Converter();
|
const converter = new Converter();
|
||||||
|
|
||||||
async function fetchReleases(scroll = true) {
|
async function fetchReleases(scroll = true) {
|
||||||
|
this.done = false;
|
||||||
|
|
||||||
const { tag, releases, totalCount } = await this.$store.dispatch('fetchTagBySlug', {
|
const { tag, releases, totalCount } = await this.$store.dispatch('fetchTagBySlug', {
|
||||||
tagSlug: this.$route.params.tagSlug,
|
tagSlug: this.$route.params.tagSlug,
|
||||||
pageNumber: Number(this.$route.params.pageNumber),
|
pageNumber: Number(this.$route.params.pageNumber),
|
||||||
|
@ -107,6 +112,8 @@ async function fetchReleases(scroll = true) {
|
||||||
this.hasMedia = this.tag.poster || this.tag.photos.length > 0;
|
this.hasMedia = this.tag.poster || this.tag.photos.length > 0;
|
||||||
this.description = this.tag.description && converter.makeHtml(escapeHtml(this.tag.description));
|
this.description = this.tag.description && converter.makeHtml(escapeHtml(this.tag.description));
|
||||||
|
|
||||||
|
this.done = true;
|
||||||
|
|
||||||
if (this.hasMedia) {
|
if (this.hasMedia) {
|
||||||
this.showBannerCampaign = true;
|
this.showBannerCampaign = true;
|
||||||
}
|
}
|
||||||
|
@ -146,6 +153,7 @@ export default {
|
||||||
tag: null,
|
tag: null,
|
||||||
description: null,
|
description: null,
|
||||||
releases: null,
|
releases: null,
|
||||||
|
done: false,
|
||||||
totalCount: 0,
|
totalCount: 0,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
pageTitle: null,
|
pageTitle: null,
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.199.15",
|
"version": "1.199.16",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.199.15",
|
"version": "1.199.16",
|
||||||
"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.199.15",
|
"version": "1.199.16",
|
||||||
"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": {
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 7.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.1 MiB |
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.8 MiB |
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
|
@ -665,12 +665,13 @@ const tagMedia = [
|
||||||
['blonde', 'shawna_lenee_sunrisekings', 'Shawna Lenee', 'sunrisekings'],
|
['blonde', 'shawna_lenee_sunrisekings', 'Shawna Lenee', 'sunrisekings'],
|
||||||
['blonde', 2, 'Isabelle Deltore', 'herlimit'],
|
['blonde', 2, 'Isabelle Deltore', 'herlimit'],
|
||||||
['blowbang', 'ana_foxxx_hardx', 'Ana Foxxx in "Facialized Vol. 4"', 'hardx'],
|
['blowbang', 'ana_foxxx_hardx', 'Ana Foxxx in "Facialized Vol. 4"', 'hardx'],
|
||||||
|
['blowbang', 'lisey_sweet_legalporno', 'Lisey Sweet in GIO816', 'legalporno'],
|
||||||
['blowbang', 'angela_white_julesjordan', 'Angela White in "Her Biggest Gangbang Ever"', 'julesjordan'],
|
['blowbang', 'angela_white_julesjordan', 'Angela White in "Her Biggest Gangbang Ever"', 'julesjordan'],
|
||||||
['blowbang', 'monika_fox_legalporno', 'Monika Fox in GL479', 'legalporno'],
|
['blowbang', 'monika_fox_legalporno', 'Monika Fox in GL479', 'legalporno'],
|
||||||
['blowbang', 0, 'Lacy Lennon in "Lacy Lennon\'s First Blowbang"', 'hardx'],
|
['blowbang', 0, 'Lacy Lennon in "Lacy Lennon\'s First Blowbang"', 'hardx'],
|
||||||
['blowbang', 'zaawaadi_roccosiffredi_1', 'Zaawaadi in "My Name Is Zaawaadi"', 'roccosiffredi'],
|
['blowbang', 'zaawaadi_roccosiffredi_1', 'Zaawaadi in "My Name Is Zaawaadi"', 'roccosiffredi'],
|
||||||
['blowbang', 'gina_gerson_assholefever', 'Gina Gerson in "Oppa Gangbang Style"', 'assholefever'],
|
|
||||||
['blowbang', 1, 'Nicole Black in GIO1680', 'legalporno'],
|
['blowbang', 1, 'Nicole Black in GIO1680', 'legalporno'],
|
||||||
|
['blowbang', 'gina_gerson_assholefever', 'Gina Gerson in "Oppa Gangbang Style"', 'assholefever'],
|
||||||
['blowjob', 'clanddi_jinkcego_ddfbusty_1', 'Clanddi Jinkcego', 'ddfbusty'],
|
['blowjob', 'clanddi_jinkcego_ddfbusty_1', 'Clanddi Jinkcego', 'ddfbusty'],
|
||||||
['blowjob', 'juelz_ventura_babygotboobs', 'Juelz Ventura in "A Deep DP For Dessert"', 'babygotboobs'],
|
['blowjob', 'juelz_ventura_babygotboobs', 'Juelz Ventura in "A Deep DP For Dessert"', 'babygotboobs'],
|
||||||
['blowjob', 4, 'Chloe Cherry in "Chloe\'s Big Anal"', 'darkx'],
|
['blowjob', 4, 'Chloe Cherry in "Chloe\'s Big Anal"', 'darkx'],
|
||||||
|
@ -1020,6 +1021,7 @@ const tagMedia = [
|
||||||
['trainbang', 1, 'Ria Sunn', 'private'],
|
['trainbang', 1, 'Ria Sunn', 'private'],
|
||||||
['trainbang', 0, 'Nicole Black in GIO971', 'legalporno'],
|
['trainbang', 0, 'Nicole Black in GIO971', 'legalporno'],
|
||||||
['tap', 4, 'Francys Belle in GIO1103', 'legalporno'],
|
['tap', 4, 'Francys Belle in GIO1103', 'legalporno'],
|
||||||
|
['tap', 'lisey_sweet_legalporno', 'Lisey Sweet in GIO816', 'legalporno'],
|
||||||
['tap', 3, 'Julia Red in GIO1007', 'legalporno'],
|
['tap', 3, 'Julia Red in GIO1007', 'legalporno'],
|
||||||
['tap', 1, 'Natasha Teen in SZ2098', 'legalporno'],
|
['tap', 1, 'Natasha Teen in SZ2098', 'legalporno'],
|
||||||
['tap', 2, 'Kira Thorn in GIO1018', 'legalporno'],
|
['tap', 2, 'Kira Thorn in GIO1018', 'legalporno'],
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
const log = require('why-is-node-running');
|
// const log = require('why-is-node-running');
|
||||||
const Inspector = require('inspector-api');
|
const Inspector = require('inspector-api');
|
||||||
const fs = require('fs').promises;
|
const fs = require('fs').promises;
|
||||||
const dayjs = require('dayjs');
|
const dayjs = require('dayjs');
|
||||||
|
@ -24,8 +24,10 @@ const getFileEntries = require('./utils/file-entries');
|
||||||
const inspector = new Inspector();
|
const inspector = new Inspector();
|
||||||
|
|
||||||
function logActive() {
|
function logActive() {
|
||||||
|
console.log('log active!');
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
log();
|
// log();
|
||||||
logActive();
|
logActive();
|
||||||
}, typeof argv.logActive === 'number' ? argv.logActive : 60000);
|
}, typeof argv.logActive === 'number' ? argv.logActive : 60000);
|
||||||
}
|
}
|
||||||
|
|
25
src/deep.js
25
src/deep.js
|
@ -5,7 +5,6 @@ const { mergeAdvanced: merge } = require('object-merge-advanced');
|
||||||
|
|
||||||
const argv = require('./argv');
|
const argv = require('./argv');
|
||||||
const include = require('./utils/argv-include')(argv);
|
const include = require('./utils/argv-include')(argv);
|
||||||
const { resolveScraper, resolveLayoutScraper } = require('./scrapers/resolve');
|
|
||||||
const { fetchReleaseEntities, urlToSiteSlug } = require('./entities');
|
const { fetchReleaseEntities, urlToSiteSlug } = require('./entities');
|
||||||
const logger = require('./logger')(__filename);
|
const logger = require('./logger')(__filename);
|
||||||
const qu = require('./utils/qu');
|
const qu = require('./utils/qu');
|
||||||
|
@ -96,10 +95,9 @@ async function scrapeRelease(baseRelease, entitiesBySlug, type = 'scene') {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const scraper = resolveScraper(entity);
|
const layoutScraper = entity.scraper;
|
||||||
const layoutScraper = resolveLayoutScraper(entity, scraper);
|
|
||||||
|
|
||||||
if (!layoutScraper) {
|
if (!entity.scraper) {
|
||||||
logger.warn(`Could not find scraper for ${baseRelease.url}`);
|
logger.warn(`Could not find scraper for ${baseRelease.url}`);
|
||||||
return baseRelease;
|
return baseRelease;
|
||||||
}
|
}
|
||||||
|
@ -114,13 +112,16 @@ async function scrapeRelease(baseRelease, entitiesBySlug, type = 'scene') {
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
...include,
|
...include,
|
||||||
|
beforeFetchScene: entity.preData,
|
||||||
parameters: getRecursiveParameters(entity),
|
parameters: getRecursiveParameters(entity),
|
||||||
};
|
};
|
||||||
|
|
||||||
const scrapedRelease = type === 'scene'
|
const rawScrapedRelease = type === 'scene'
|
||||||
? await fetchScene(layoutScraper, baseRelease.url, entity, baseRelease, options, null)
|
? await fetchScene(layoutScraper, baseRelease.url, entity, baseRelease, options, null)
|
||||||
: await layoutScraper.fetchMovie(baseRelease.url, entity, baseRelease, options, null);
|
: await layoutScraper.fetchMovie(baseRelease.url, entity, baseRelease, options, null);
|
||||||
|
|
||||||
|
const scrapedRelease = rawScrapedRelease?.scene || rawScrapedRelease;
|
||||||
|
|
||||||
if (!scrapedRelease || typeof scrapedRelease !== 'object' || Array.isArray(scrapedRelease)) {
|
if (!scrapedRelease || typeof scrapedRelease !== 'object' || Array.isArray(scrapedRelease)) {
|
||||||
// scraper is unable to fetch the releases and returned a HTTP code or null
|
// scraper is unable to fetch the releases and returned a HTTP code or null
|
||||||
throw new Error(`Scraper returned '${scrapedRelease}' when fetching latest from '${entity.name}' (${entity.parent?.name})`);
|
throw new Error(`Scraper returned '${scrapedRelease}' when fetching latest from '${entity.name}' (${entity.parent?.name})`);
|
||||||
|
@ -170,9 +171,21 @@ async function scrapeRelease(baseRelease, entitiesBySlug, type = 'scene') {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function scrapeReleases(baseReleases, entitiesBySlug, type) {
|
async function scrapeReleases(baseReleases, entitiesBySlug, type) {
|
||||||
|
const entitiesWithBeforeDataEntries = await Promise.all(Object.entries(entitiesBySlug).map(async ([slug, entity]) => {
|
||||||
|
if (entity.scraper?.beforeFetchScene) {
|
||||||
|
const preData = await entity.scraper.beforeFetchScene(entity);
|
||||||
|
|
||||||
|
return [slug, { ...entity, preData }];
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}));
|
||||||
|
|
||||||
|
const entitiesWithBeforeDataBySlug = Object.fromEntries(entitiesWithBeforeDataEntries.filter(Boolean));
|
||||||
|
|
||||||
return Promise.map(
|
return Promise.map(
|
||||||
baseReleases,
|
baseReleases,
|
||||||
async baseRelease => scrapeRelease(baseRelease, entitiesBySlug, type),
|
async baseRelease => scrapeRelease(baseRelease, entitiesWithBeforeDataBySlug, type),
|
||||||
{ concurrency: 10 },
|
{ concurrency: 10 },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ const argv = require('./argv');
|
||||||
const knex = require('./knex');
|
const knex = require('./knex');
|
||||||
const { deleteScenes, deleteMovies } = require('./releases');
|
const { deleteScenes, deleteMovies } = require('./releases');
|
||||||
const { flushOrphanedMedia } = require('./media');
|
const { flushOrphanedMedia } = require('./media');
|
||||||
|
const { resolveScraper, resolveLayoutScraper } = require('./scrapers/resolve');
|
||||||
|
|
||||||
function getRecursiveParent(entity) {
|
function getRecursiveParent(entity) {
|
||||||
if (!entity) {
|
if (!entity) {
|
||||||
|
@ -71,6 +72,9 @@ function curateEntity(entity, includeParameters = false) {
|
||||||
}, includeParameters));
|
}, includeParameters));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const scraper = resolveScraper(curatedEntity);
|
||||||
|
curatedEntity.scraper = resolveLayoutScraper(entity, scraper);
|
||||||
|
|
||||||
return curatedEntity;
|
return curatedEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +191,6 @@ async function fetchEntitiesBySlug(entitySlugs, sort = 'asc') {
|
||||||
array['parent'] as parent_path
|
array['parent'] as parent_path
|
||||||
FROM entities
|
FROM entities
|
||||||
WHERE slug = ANY(:entitySlugs)
|
WHERE slug = ANY(:entitySlugs)
|
||||||
OR substring(url from 'https%://%#"[a-z0-9-]+#".(com|net)%' for '#') = ANY(:entitySlugs)
|
|
||||||
|
|
||||||
UNION ALL
|
UNION ALL
|
||||||
|
|
||||||
|
|
|
@ -171,6 +171,7 @@ async function getSession(site, parameters) {
|
||||||
session,
|
session,
|
||||||
interval: parameters?.interval,
|
interval: parameters?.interval,
|
||||||
concurrency: parameters?.concurrency,
|
concurrency: parameters?.concurrency,
|
||||||
|
parse: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
|
@ -293,7 +294,7 @@ async function fetchScene(url, site, baseScene, options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const entryId = new URL(url).pathname.match(/\/(\d+)/)?.[1];
|
const entryId = new URL(url).pathname.match(/\/(\d+)/)?.[1];
|
||||||
const { session, instanceToken } = await getSession(site, options.parameters);
|
const { session, instanceToken } = options.beforeFetchScene || await getSession(site, options.parameters);
|
||||||
|
|
||||||
const res = await http.get(`https://site-api.project1service.com/v2/releases/${entryId}`, {
|
const res = await http.get(`https://site-api.project1service.com/v2/releases/${entryId}`, {
|
||||||
session,
|
session,
|
||||||
|
@ -305,7 +306,9 @@ async function fetchScene(url, site, baseScene, options) {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.status === 200 && res.body.result) {
|
if (res.status === 200 && res.body.result) {
|
||||||
return scrapeScene(res.body.result, url, site);
|
return {
|
||||||
|
scene: scrapeScene(res.body.result, url, site),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -360,6 +363,7 @@ async function fetchProfile({ name: actorName, slug: actorSlug }, { entity, para
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
beforeFetchScene: getSession,
|
||||||
scrapeLatestX,
|
scrapeLatestX,
|
||||||
fetchLatest,
|
fetchLatest,
|
||||||
fetchUpcoming,
|
fetchUpcoming,
|
||||||
|
|
|
@ -23,6 +23,7 @@ Promise.config({
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
timeout: argv.requestTimeout,
|
timeout: argv.requestTimeout,
|
||||||
encodeJSON: true,
|
encodeJSON: true,
|
||||||
|
parse: false,
|
||||||
headers: {
|
headers: {
|
||||||
'user-agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1',
|
'user-agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1',
|
||||||
},
|
},
|
||||||
|
@ -114,14 +115,14 @@ async function finalizeResult(res, options) {
|
||||||
|
|
||||||
if (Buffer.isBuffer(res.body)) {
|
if (Buffer.isBuffer(res.body)) {
|
||||||
const html = res.body.toString();
|
const html = res.body.toString();
|
||||||
const window = new JSDOM(html, { virtualConsole, ...options.extract }).window;
|
const window = options?.parse ? new JSDOM(html, { virtualConsole, ...options.extract }).window : null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...res,
|
...res,
|
||||||
body: html,
|
body: html,
|
||||||
html,
|
html,
|
||||||
status: res.statusCode,
|
status: res.statusCode,
|
||||||
document: window.document,
|
document: window?.document || null,
|
||||||
window,
|
window,
|
||||||
ok: res.statusCode >= 200 && res.statusCode <= 299,
|
ok: res.statusCode >= 200 && res.statusCode <= 299,
|
||||||
};
|
};
|
||||||
|
|
|
@ -521,7 +521,11 @@ function extractAll(htmlValue, selector, options) {
|
||||||
async function request(method = 'get', urlValue, body, selector, headers, options, queryAll = false) {
|
async function request(method = 'get', urlValue, body, selector, headers, options, queryAll = false) {
|
||||||
const res = await (method === 'post'
|
const res = await (method === 'post'
|
||||||
? http.post(urlValue, body, { ...options, headers })
|
? http.post(urlValue, body, { ...options, headers })
|
||||||
: http[method](urlValue, { ...options, headers }));
|
: http[method](urlValue, {
|
||||||
|
...options,
|
||||||
|
headers,
|
||||||
|
parse: true,
|
||||||
|
}));
|
||||||
|
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const item = queryAll
|
const item = queryAll
|
||||||
|
|
Loading…
Reference in New Issue