2019-03-18 03:46:53 +00:00
|
|
|
'use strict';
|
|
|
|
|
2019-04-05 01:45:40 +00:00
|
|
|
const config = require('config');
|
2019-03-18 03:46:53 +00:00
|
|
|
const yargs = require('yargs');
|
|
|
|
|
|
|
|
const { argv } = yargs
|
|
|
|
.command('npm start')
|
2019-12-13 02:28:52 +00:00
|
|
|
.option('server', {
|
|
|
|
describe: 'Start web server',
|
|
|
|
type: 'boolean',
|
|
|
|
alias: 'web',
|
|
|
|
})
|
2019-11-16 22:37:33 +00:00
|
|
|
.option('scrape', {
|
|
|
|
describe: 'Scrape sites and networks defined in configuration',
|
|
|
|
type: 'boolean',
|
|
|
|
})
|
2019-04-04 02:00:28 +00:00
|
|
|
.option('networks', {
|
2019-11-16 22:37:33 +00:00
|
|
|
describe: 'Networks to scrape (overrides configuration)',
|
2019-04-04 02:00:28 +00:00
|
|
|
type: 'array',
|
|
|
|
alias: 'network',
|
|
|
|
})
|
|
|
|
.option('sites', {
|
2019-11-16 22:37:33 +00:00
|
|
|
describe: 'Sites to scrape (overrides configuration)',
|
2019-04-04 02:00:28 +00:00
|
|
|
type: 'array',
|
|
|
|
alias: 'site',
|
|
|
|
})
|
2019-11-17 02:56:45 +00:00
|
|
|
.option('actors', {
|
|
|
|
describe: 'Scrape actors by name or slug',
|
|
|
|
type: 'array',
|
|
|
|
alias: 'actor',
|
|
|
|
})
|
2020-03-22 02:50:24 +00:00
|
|
|
.option('actor-scenes', {
|
|
|
|
describe: 'Fetch all scenes for an actor',
|
2020-01-31 00:55:55 +00:00
|
|
|
type: 'boolean',
|
2020-03-09 04:06:37 +00:00
|
|
|
alias: 'with-releases',
|
2020-01-31 00:55:55 +00:00
|
|
|
default: false,
|
|
|
|
})
|
2020-03-22 02:50:24 +00:00
|
|
|
.option('movie-scenes', {
|
|
|
|
describe: 'Fetch all scenes for a movie',
|
|
|
|
type: 'boolean',
|
|
|
|
alias: 'with-releases',
|
|
|
|
default: false,
|
|
|
|
})
|
|
|
|
.option('scene-movies', {
|
2020-03-09 04:06:37 +00:00
|
|
|
describe: 'Fetch movies for scenes',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
|
|
|
})
|
2020-03-22 02:50:24 +00:00
|
|
|
.option('profiles', {
|
2020-02-01 00:15:40 +00:00
|
|
|
describe: 'Scrape profiles for new actors after fetching scenes',
|
|
|
|
type: 'boolean',
|
2020-03-22 02:50:24 +00:00
|
|
|
alias: 'bios',
|
2020-02-04 02:12:09 +00:00
|
|
|
default: false,
|
2020-02-01 00:15:40 +00:00
|
|
|
})
|
2019-12-13 02:28:52 +00:00
|
|
|
.option('scene', {
|
|
|
|
describe: 'Scrape scene info from URL',
|
|
|
|
type: 'array',
|
2020-03-09 04:06:37 +00:00
|
|
|
alias: 'scenes',
|
2019-12-13 02:28:52 +00:00
|
|
|
})
|
|
|
|
.option('movie', {
|
|
|
|
describe: 'Scrape movie info from URL',
|
|
|
|
type: 'array',
|
2020-03-09 04:06:37 +00:00
|
|
|
alias: 'movies',
|
2019-12-13 02:28:52 +00:00
|
|
|
})
|
2019-11-30 04:55:32 +00:00
|
|
|
.option('sources', {
|
2019-12-06 23:42:47 +00:00
|
|
|
describe: 'Use these scrapers for actor data',
|
2019-11-30 04:55:32 +00:00
|
|
|
type: 'array',
|
|
|
|
alias: 'source',
|
|
|
|
})
|
2019-11-16 02:33:36 +00:00
|
|
|
.option('deep', {
|
|
|
|
describe: 'Fetch details for all releases',
|
|
|
|
type: 'boolean',
|
2020-02-01 00:15:40 +00:00
|
|
|
default: true,
|
|
|
|
})
|
|
|
|
.option('latest', {
|
|
|
|
describe: 'Scrape latest releases if available',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
|
|
|
})
|
|
|
|
.option('upcoming', {
|
|
|
|
describe: 'Scrape upcoming releases if available',
|
|
|
|
type: 'boolean',
|
2019-11-16 02:33:36 +00:00
|
|
|
default: true,
|
|
|
|
})
|
2019-11-17 02:56:45 +00:00
|
|
|
.option('redownload', {
|
|
|
|
describe: 'Don\'t ignore duplicates, update existing entries',
|
|
|
|
type: 'boolean',
|
|
|
|
alias: 'force',
|
|
|
|
})
|
2019-04-05 01:45:40 +00:00
|
|
|
.option('after', {
|
|
|
|
describe: 'Don\'t fetch scenes older than',
|
|
|
|
type: 'string',
|
|
|
|
default: config.fetchAfter.join(' '),
|
|
|
|
})
|
2020-02-11 03:58:18 +00:00
|
|
|
.option('last', {
|
|
|
|
describe: 'Get the latest x releases, no matter the date range',
|
|
|
|
type: 'number',
|
|
|
|
})
|
2020-02-06 22:15:28 +00:00
|
|
|
.option('null-date-limit', {
|
|
|
|
describe: 'Limit amount of scenes when dates are missing.',
|
2019-11-04 04:47:37 +00:00
|
|
|
type: 'number',
|
2020-02-06 22:15:28 +00:00
|
|
|
default: config.nullDateLimit,
|
|
|
|
alias: 'limit',
|
2019-11-04 04:47:37 +00:00
|
|
|
})
|
2020-02-11 03:58:18 +00:00
|
|
|
.option('page', {
|
|
|
|
describe: 'Page to start scraping at',
|
|
|
|
type: 'number',
|
|
|
|
default: 1,
|
|
|
|
})
|
2019-04-05 01:45:40 +00:00
|
|
|
.option('save', {
|
|
|
|
describe: 'Save fetched releases to database',
|
|
|
|
type: 'boolean',
|
2019-09-08 01:53:09 +00:00
|
|
|
default: true,
|
2019-04-05 01:45:40 +00:00
|
|
|
})
|
2020-02-22 02:22:30 +00:00
|
|
|
.option('media', {
|
|
|
|
describe: 'Include any release media',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
|
|
|
})
|
2020-03-24 02:48:24 +00:00
|
|
|
.option('media-limit', {
|
|
|
|
describe: 'Maximum amount of assets of each type per release',
|
|
|
|
type: 'number',
|
|
|
|
default: config.media.limit,
|
|
|
|
})
|
2020-02-26 21:33:15 +00:00
|
|
|
.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,
|
|
|
|
})
|
2020-02-22 02:22:30 +00:00
|
|
|
.option('posters', {
|
|
|
|
describe: 'Include release posters',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
2020-03-09 04:06:37 +00:00
|
|
|
alias: 'poster',
|
2020-02-22 02:22:30 +00:00
|
|
|
})
|
|
|
|
.option('covers', {
|
|
|
|
describe: 'Include release covers',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
2020-03-09 04:06:37 +00:00
|
|
|
alias: 'cover',
|
2020-02-22 02:22:30 +00:00
|
|
|
})
|
|
|
|
.option('photos', {
|
|
|
|
describe: 'Include release photos',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
|
|
|
})
|
|
|
|
.option('trailers', {
|
|
|
|
describe: 'Include release trailers',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
2020-03-09 04:06:37 +00:00
|
|
|
alias: 'trailer',
|
2020-02-22 02:22:30 +00:00
|
|
|
})
|
|
|
|
.option('teasers', {
|
|
|
|
describe: 'Include release teasers',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
2020-03-09 04:06:37 +00:00
|
|
|
alias: 'teaser',
|
2020-02-22 02:22:30 +00:00
|
|
|
})
|
|
|
|
.option('avatars', {
|
|
|
|
describe: 'Include actor avatars',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
|
|
|
})
|
2020-02-06 22:15:28 +00:00
|
|
|
.option('inspect', {
|
|
|
|
describe: 'Show data in console.',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
})
|
2020-01-08 22:33:24 +00:00
|
|
|
.option('level', {
|
|
|
|
describe: 'Log level',
|
|
|
|
type: 'string',
|
|
|
|
default: process.env.NODE_ENV === 'development' ? 'silly' : 'info',
|
|
|
|
})
|
2019-03-24 00:29:22 +00:00
|
|
|
.option('debug', {
|
|
|
|
describe: 'Show error stack traces',
|
|
|
|
type: 'boolean',
|
2019-12-09 04:00:49 +00:00
|
|
|
default: process.env.NODE_ENV === 'development',
|
2020-02-26 23:38:11 +00:00
|
|
|
})
|
2020-03-10 22:46:55 +00:00
|
|
|
.option('update-search', {
|
|
|
|
describe: 'Update search documents for all releases.',
|
2020-02-26 23:38:11 +00:00
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
2019-03-18 03:46:53 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = argv;
|