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-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',
|
|
|
|
})
|
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',
|
|
|
|
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-11-16 02:33:36 +00:00
|
|
|
.option('url', {
|
|
|
|
describe: 'Scrape scene info from URL',
|
2019-11-28 04:36:22 +00:00
|
|
|
type: 'array',
|
2019-11-16 02:33:36 +00:00
|
|
|
alias: 'fetch',
|
|
|
|
})
|
2019-04-05 01:45:40 +00:00
|
|
|
.option('after', {
|
|
|
|
describe: 'Don\'t fetch scenes older than',
|
|
|
|
type: 'string',
|
|
|
|
default: config.fetchAfter.join(' '),
|
2019-11-17 02:56:45 +00:00
|
|
|
alias: 'limit',
|
2019-04-05 01:45:40 +00:00
|
|
|
})
|
2019-11-04 04:47:37 +00:00
|
|
|
.option('pages', {
|
|
|
|
describe: 'Limit pages to scrape per site. Only used when no dates are found or --after is unset.',
|
|
|
|
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
|
|
|
})
|
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;
|