forked from DebaucheryLibrarian/traxxx
197 lines
4.4 KiB
JavaScript
197 lines
4.4 KiB
JavaScript
'use strict';
|
|
|
|
const config = require('config');
|
|
const yargs = require('yargs');
|
|
|
|
const { argv } = yargs
|
|
.command('npm start')
|
|
.option('server', {
|
|
describe: 'Start web server',
|
|
type: 'boolean',
|
|
alias: 'web',
|
|
})
|
|
.option('scrape', {
|
|
describe: 'Scrape sites and networks defined in configuration',
|
|
type: 'boolean',
|
|
})
|
|
.option('networks', {
|
|
describe: 'Networks to scrape (overrides configuration)',
|
|
type: 'array',
|
|
alias: 'network',
|
|
})
|
|
.option('sites', {
|
|
describe: 'Sites to scrape (overrides configuration)',
|
|
type: 'array',
|
|
alias: 'site',
|
|
})
|
|
.option('actors', {
|
|
describe: 'Scrape actors by name or slug',
|
|
type: 'array',
|
|
alias: 'actor',
|
|
})
|
|
.option('actor-scenes', {
|
|
describe: 'Fetch all scenes for an actor',
|
|
type: 'boolean',
|
|
alias: 'with-releases',
|
|
default: false,
|
|
})
|
|
.option('movie-scenes', {
|
|
describe: 'Fetch all scenes for a movie',
|
|
type: 'boolean',
|
|
alias: 'with-releases',
|
|
default: false,
|
|
})
|
|
.option('scene-movies', {
|
|
describe: 'Fetch movies for scenes',
|
|
type: 'boolean',
|
|
default: true,
|
|
})
|
|
.option('profiles', {
|
|
describe: 'Scrape profiles for new actors after fetching scenes',
|
|
type: 'boolean',
|
|
alias: 'with-actors',
|
|
default: false,
|
|
})
|
|
.option('scene', {
|
|
describe: 'Scrape scene info from URL',
|
|
type: 'array',
|
|
alias: 'scenes',
|
|
})
|
|
.option('movie', {
|
|
describe: 'Scrape movie info from URL',
|
|
type: 'array',
|
|
alias: 'movies',
|
|
})
|
|
.option('sources', {
|
|
describe: 'Use these scrapers for actor data',
|
|
type: 'array',
|
|
alias: 'source',
|
|
})
|
|
.option('deep', {
|
|
describe: 'Fetch details for all releases',
|
|
type: 'boolean',
|
|
default: true,
|
|
})
|
|
.option('latest', {
|
|
describe: 'Scrape latest releases if available',
|
|
type: 'boolean',
|
|
default: true,
|
|
})
|
|
.option('upcoming', {
|
|
describe: 'Scrape upcoming releases if available',
|
|
type: 'boolean',
|
|
default: true,
|
|
})
|
|
.option('redownload', {
|
|
describe: 'Don\'t ignore duplicates, update existing entries',
|
|
type: 'boolean',
|
|
alias: 'force',
|
|
})
|
|
.option('after', {
|
|
describe: 'Don\'t fetch scenes older than',
|
|
type: 'string',
|
|
default: config.fetchAfter.join(' '),
|
|
})
|
|
.option('last', {
|
|
describe: 'Get the latest x releases, no matter the date range',
|
|
type: 'number',
|
|
})
|
|
.option('null-date-limit', {
|
|
describe: 'Limit amount of scenes when dates are missing.',
|
|
type: 'number',
|
|
default: config.nullDateLimit,
|
|
alias: 'limit',
|
|
})
|
|
.option('page', {
|
|
describe: 'Page to start scraping at',
|
|
type: 'number',
|
|
default: 1,
|
|
})
|
|
.option('save', {
|
|
describe: 'Save fetched releases to database',
|
|
type: 'boolean',
|
|
default: true,
|
|
})
|
|
.option('media', {
|
|
describe: 'Include any release media',
|
|
type: 'boolean',
|
|
default: true,
|
|
})
|
|
.option('media-limit', {
|
|
describe: 'Maximum amount of assets of each type per release',
|
|
type: 'number',
|
|
default: config.media.limit,
|
|
})
|
|
.option('images', {
|
|
describe: 'Include any photos, posters or covers',
|
|
type: 'boolean',
|
|
default: true,
|
|
alias: 'pics',
|
|
})
|
|
.option('videos', {
|
|
describe: 'Include any trailers or teasers',
|
|
type: 'boolean',
|
|
default: true,
|
|
})
|
|
.option('posters', {
|
|
describe: 'Include release posters',
|
|
type: 'boolean',
|
|
default: true,
|
|
alias: 'poster',
|
|
})
|
|
.option('covers', {
|
|
describe: 'Include release covers',
|
|
type: 'boolean',
|
|
default: true,
|
|
alias: 'cover',
|
|
})
|
|
.option('photos', {
|
|
describe: 'Include release photos',
|
|
type: 'boolean',
|
|
default: true,
|
|
})
|
|
.option('trailers', {
|
|
describe: 'Include release trailers',
|
|
type: 'boolean',
|
|
default: true,
|
|
alias: 'trailer',
|
|
})
|
|
.option('teasers', {
|
|
describe: 'Include release teasers',
|
|
type: 'boolean',
|
|
default: true,
|
|
alias: 'teaser',
|
|
})
|
|
.option('avatars', {
|
|
describe: 'Include actor avatars',
|
|
type: 'boolean',
|
|
default: true,
|
|
})
|
|
.option('inspect', {
|
|
describe: 'Show data in console.',
|
|
type: 'boolean',
|
|
default: false,
|
|
})
|
|
.option('level', {
|
|
describe: 'Log level',
|
|
type: 'string',
|
|
default: process.env.NODE_ENV === 'development' ? 'silly' : 'info',
|
|
})
|
|
.option('resolve-place', {
|
|
describe: 'Call OSM Nominatim API for actor place of birth and residence. Raw value discarded if disabled.',
|
|
type: 'boolean',
|
|
default: true,
|
|
})
|
|
.option('debug', {
|
|
describe: 'Show error stack traces',
|
|
type: 'boolean',
|
|
default: process.env.NODE_ENV === 'development',
|
|
})
|
|
.option('update-search', {
|
|
describe: 'Update search documents for all releases.',
|
|
type: 'boolean',
|
|
default: false,
|
|
});
|
|
|
|
module.exports = argv;
|