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-01-31 00:55:55 +00:00
|
|
|
.option('with-releases', {
|
|
|
|
describe: 'Fetch all releases for an actor',
|
|
|
|
type: 'boolean',
|
2020-01-31 18:25:42 +00:00
|
|
|
alias: 'with-scenes',
|
2020-01-31 00:55:55 +00:00
|
|
|
default: false,
|
|
|
|
})
|
2020-02-01 00:15:40 +00:00
|
|
|
.option('with-profiles', {
|
|
|
|
describe: 'Scrape profiles for new actors after fetching scenes',
|
|
|
|
type: 'boolean',
|
|
|
|
alias: 'with-actors',
|
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',
|
|
|
|
alias: 'release',
|
|
|
|
})
|
|
|
|
.option('movie', {
|
|
|
|
describe: 'Scrape movie info from URL',
|
|
|
|
type: 'array',
|
|
|
|
alias: 'dvd',
|
|
|
|
})
|
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-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
|
|
|
})
|
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-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',
|
2019-03-18 03:46:53 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = argv;
|