forked from DebaucheryLibrarian/traxxx
Fixed photo query in Aziana scraper.
This commit is contained in:
parent
2ebc2d441f
commit
b287f5c2db
|
@ -5,7 +5,8 @@ exports.up = async (knex) => {
|
||||||
table.integer('release_id')
|
table.integer('release_id')
|
||||||
.notNullable()
|
.notNullable()
|
||||||
.references('id')
|
.references('id')
|
||||||
.inTable('releases');
|
.inTable('releases')
|
||||||
|
.onDelete('cascade');
|
||||||
|
|
||||||
table.text('media_id')
|
table.text('media_id')
|
||||||
.notNullable()
|
.notNullable()
|
||||||
|
|
|
@ -2,10 +2,18 @@ exports.up = async (knex) => {
|
||||||
await knex.schema.alterTable('releases', (table) => {
|
await knex.schema.alterTable('releases', (table) => {
|
||||||
table.specificType('alt_titles', 'text ARRAY');
|
table.specificType('alt_titles', 'text ARRAY');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await knex.schema.alterTable('movies', (table) => {
|
||||||
|
table.specificType('alt_titles', 'text ARRAY');
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.down = async (knex) => {
|
exports.down = async (knex) => {
|
||||||
await knex.schema.alterTable('releases', (table) => {
|
await knex.schema.alterTable('releases', (table) => {
|
||||||
table.dropColumn('alt_titles');
|
table.dropColumn('alt_titles');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await knex.schema.alterTable('movies', (table) => {
|
||||||
|
table.dropColumn('alt_titles');
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,6 +14,7 @@ const http = require('./utils/http');
|
||||||
|
|
||||||
const logger = require('./logger')(__filename);
|
const logger = require('./logger')(__filename);
|
||||||
const knex = require('./knex');
|
const knex = require('./knex');
|
||||||
|
const redis = require('./redis');
|
||||||
const fetchUpdates = require('./updates');
|
const fetchUpdates = require('./updates');
|
||||||
const { fetchScenes, fetchMovies } = require('./deep');
|
const { fetchScenes, fetchMovies } = require('./deep');
|
||||||
const { storeScenes, storeMovies, associateMovieScenes } = require('./store-releases');
|
const { storeScenes, storeMovies, associateMovieScenes } = require('./store-releases');
|
||||||
|
@ -212,6 +213,8 @@ async function init() {
|
||||||
await http.destroyBrowserSessions();
|
await http.destroyBrowserSessions();
|
||||||
|
|
||||||
knex.destroy();
|
knex.destroy();
|
||||||
|
redis.disconnect();
|
||||||
|
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ function scrapeAll(scenes, site) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function scrapeScene({ html, qu }, url) {
|
function scrapeScene({ html, qu }, url, channel) {
|
||||||
const release = { url };
|
const release = { url };
|
||||||
|
|
||||||
release.entryId = qu.q('.stdimage', 'id', true).match(/set-target-(\d+)/)[1];
|
release.entryId = qu.q('.stdimage', 'id', true).match(/set-target-(\d+)/)[1];
|
||||||
|
@ -58,7 +58,7 @@ function scrapeScene({ html, qu }, url) {
|
||||||
const poster = qu.img('a img');
|
const poster = qu.img('a img');
|
||||||
|
|
||||||
release.poster = getFallbacks(poster);
|
release.poster = getFallbacks(poster);
|
||||||
release.photos = qu.imgs('.featured-video img', 'src0_1x').map((source) => getFallbacks(source));
|
release.caps = qu.imgs('.featured-video img', 'src0_1x', { origin: channel.url }).map((source) => getFallbacks(source));
|
||||||
|
|
||||||
return release;
|
return release;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue