Insex not fetching video when not required.
This commit is contained in:
parent
e9ba02d65d
commit
5352186319
|
@ -194,6 +194,7 @@ const { argv } = yargs
|
||||||
alias: 'pics',
|
alias: 'pics',
|
||||||
})
|
})
|
||||||
.option('videos', {
|
.option('videos', {
|
||||||
|
alias: 'video',
|
||||||
describe: 'Include any trailers or teasers',
|
describe: 'Include any trailers or teasers',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: true,
|
default: true,
|
||||||
|
|
|
@ -68,7 +68,7 @@ function scrapeLatestLegacy(scenes, site) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function scrapeScene({ query }, url, channel, session) {
|
async function scrapeScene({ query }, url, channel, parameters, session) {
|
||||||
const release = {};
|
const release = {};
|
||||||
|
|
||||||
release.title = query.cnt('.columns div.is-size-5.has-text-weight-bold');
|
release.title = query.cnt('.columns div.is-size-5.has-text-weight-bold');
|
||||||
|
@ -85,7 +85,7 @@ async function scrapeScene({ query }, url, channel, session) {
|
||||||
|
|
||||||
release.trailer = query.video();
|
release.trailer = query.video();
|
||||||
|
|
||||||
if (!release.trailer) {
|
if (!release.trailer && parameters.includeTrailers) {
|
||||||
const trailerRes = await http.get(`${channel.url}/api/play-api.php`, { session });
|
const trailerRes = await http.get(`${channel.url}/api/play-api.php`, { session });
|
||||||
|
|
||||||
if (trailerRes.ok) {
|
if (trailerRes.ok) {
|
||||||
|
@ -147,12 +147,12 @@ async function fetchLatestLegacy(site, page = 1) {
|
||||||
return res.status;
|
return res.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchScene(url, site) {
|
async function fetchScene(url, site, baseRelease, parameters) {
|
||||||
const session = http.session();
|
const session = http.session();
|
||||||
const res = await qu.get(url, null, { cookie: 'consent=yes' }, { session });
|
const res = await qu.get(url, null, { cookie: 'consent=yes' }, { session });
|
||||||
|
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
return scrapeScene(res.item, url, site, session);
|
return scrapeScene(res.item, url, site, parameters, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res.status;
|
return res.status;
|
||||||
|
|
Loading…
Reference in New Issue