forked from DebaucheryLibrarian/traxxx
Storing scene qualities. Updated Perv City scraper.
This commit is contained in:
parent
33a327a04b
commit
18b219850e
|
@ -203,6 +203,19 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="release.qualities"
|
||||
class="row"
|
||||
>
|
||||
<span class="row-label">Available qualities</span>
|
||||
|
||||
<span
|
||||
v-for="quality in release.qualities"
|
||||
:key="quality"
|
||||
class="quality"
|
||||
>{{ quality }}</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="release.comment"
|
||||
class="row"
|
||||
|
@ -470,6 +483,16 @@ export default {
|
|||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.quality {
|
||||
&::after {
|
||||
content: 'p, ';
|
||||
}
|
||||
|
||||
&:last-child::after {
|
||||
content: 'p',
|
||||
}
|
||||
}
|
||||
|
||||
.releases {
|
||||
margin: 0 0 .5rem 0;
|
||||
}
|
||||
|
|
|
@ -367,6 +367,7 @@ const releaseFields = `
|
|||
date
|
||||
datePrecision
|
||||
slug
|
||||
qualities
|
||||
shootId
|
||||
productionDate
|
||||
comment
|
||||
|
@ -475,6 +476,7 @@ const releaseFragment = `
|
|||
duration
|
||||
createdAt
|
||||
shootId
|
||||
qualities
|
||||
productionDate
|
||||
createdBatchId
|
||||
productionLocation
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
exports.up = async (knex) => knex.schema.alterTable('releases', (table) => {
|
||||
table.specificType('qualities', 'text[]');
|
||||
});
|
||||
|
||||
exports.down = async (knex) => knex.schema.alterTable('releases', (table) => {
|
||||
table.dropColumn('qualities');
|
||||
});
|
|
@ -0,0 +1,12 @@
|
|||
exports.up = async (knex) => knex.raw(`
|
||||
CREATE MATERIALIZED VIEW entities_stats
|
||||
AS
|
||||
SELECT entities.id AS entity_id, count(releases.id) AS releases_count
|
||||
FROM entities
|
||||
LEFT JOIN releases ON releases.entity_id = entities.id
|
||||
GROUP BY entities.id;
|
||||
`);
|
||||
|
||||
exports.down = async (knex) => knex.raw(`
|
||||
DROP MATERIALIZED VIEW entities_stats;
|
||||
`);
|
|
@ -12,6 +12,13 @@ const channelCodes = {
|
|||
uha: 'upherasshole',
|
||||
};
|
||||
|
||||
const qualities = {
|
||||
v4k: 2160,
|
||||
vFullHD: 1080,
|
||||
vHD: 720,
|
||||
vSD: 480,
|
||||
};
|
||||
|
||||
const channelRegExp = new RegExp(Object.keys(channelCodes).join('|'), 'i');
|
||||
|
||||
function scrapeAll(scenes, entity) {
|
||||
|
@ -42,9 +49,12 @@ function scrapeScene({ query }) {
|
|||
release.entryId = query.q('.trailerLeft img', 'id').match(/set-target-(\d+)/)[1];
|
||||
|
||||
release.title = query.cnt('.infoHeader h1');
|
||||
release.description = query.cnt('.infoBox p');
|
||||
release.description = query.cnt('.description');
|
||||
release.duration = query.duration('.tRuntime');
|
||||
|
||||
release.actors = query.cnts('.infoBox .tour_update_models a');
|
||||
release.tags = query.cnts('.tagcats a');
|
||||
release.qualities = query.imgs('.avaiFormate img').map((src) => qualities[src.match(/\/(\w+)\.png/)[1]]).filter(Boolean);
|
||||
|
||||
release.poster = query.img('.posterimg');
|
||||
release.photos = query.imgs('.trailerSnaps img').slice(1); // first photo is poster in lower quality
|
||||
|
|
|
@ -38,11 +38,8 @@ async function curateReleaseEntry(release, batchId, existingRelease, type = 'sce
|
|||
date_precision: release.datePrecision,
|
||||
slug,
|
||||
description: release.description,
|
||||
qualities: release.qualities.map(Number).filter(Boolean),
|
||||
comment: release.comment,
|
||||
// director: release.director,
|
||||
// likes: release.rating && release.rating.likes,
|
||||
// dislikes: release.rating && release.rating.dislikes,
|
||||
// rating: release.rating && release.rating.stars && Math.floor(release.rating.stars),
|
||||
deep: typeof release.deep === 'boolean' ? release.deep : false,
|
||||
deep_url: release.deepUrl,
|
||||
updated_batch_id: batchId,
|
||||
|
@ -72,6 +69,8 @@ async function curateReleaseEntry(release, batchId, existingRelease, type = 'sce
|
|||
curatedRelease.created_batch_id = batchId;
|
||||
}
|
||||
|
||||
console.log(curatedRelease);
|
||||
|
||||
return curatedRelease;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue