[HD] Move -s to --srz, and add warnings
Add warnings for commands that haven't yet been added to hidive, and move -s to --srz since it selects a series, and not a season.
This commit is contained in:
parent
1c39e349ad
commit
211a593796
3 changed files with 24 additions and 16 deletions
34
hidive.ts
34
hidive.ts
|
|
@ -134,24 +134,32 @@ export default class Hidive implements ServiceClass {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
const selected = await this.selectSeries(parseInt(argv.s), argv.e, argv.but, argv.all);
|
||||
if (selected.isOk && selected.showData) {
|
||||
for (const select of selected.value) {
|
||||
//download episode
|
||||
if (!(await this.downloadEpisode(select, {...argv}))) {
|
||||
console.error(`Unable to download selected episode ${select.episodeInformation.episodeNumber}`);
|
||||
return false;
|
||||
}
|
||||
console.error('-s is not yet implemented in the new API, use --srz instead');
|
||||
}
|
||||
return true;
|
||||
} else if (argv.srz && !isNaN(parseInt(argv.srz,10)) && parseInt(argv.srz,10) > 0) {
|
||||
const selected = await this.selectSeries(parseInt(argv.srz), argv.e, argv.but, argv.all);
|
||||
if (selected.isOk && selected.showData) {
|
||||
for (const select of selected.value) {
|
||||
//download episode
|
||||
if (!(await this.downloadEpisode(select, {...argv}))) {
|
||||
console.error(`Unable to download selected episode ${select.episodeInformation.episodeNumber}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else if (argv.new) {
|
||||
if (this.api == 'old') {
|
||||
//Initilize session
|
||||
await this.doInit();
|
||||
//Get Newly Added
|
||||
await this.getNewlyAdded(argv.page);
|
||||
} else {
|
||||
await this.doInit();
|
||||
//Get Newly Added
|
||||
await this.getNewlyAdded(argv.page);
|
||||
} else {
|
||||
console.error('--new is not yet implemented in the new API');
|
||||
}
|
||||
} else if(argv.e) {
|
||||
console.error('-e is not yet supported');
|
||||
}else {
|
||||
console.info('No option selected or invalid value entered. Try --help.');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,8 @@ let argvC: {
|
|||
new: boolean | undefined;
|
||||
'movie-listing': string | undefined;
|
||||
series: string | undefined;
|
||||
s: string | undefined;
|
||||
s: string | undefined;
|
||||
srz: string | undefined;
|
||||
e: string | undefined;
|
||||
extid: string | undefined;
|
||||
q: number;
|
||||
|
|
|
|||
|
|
@ -138,8 +138,7 @@ const args: TAppArg<boolean|number|string|unknown[]>[] = [
|
|||
group: 'dl',
|
||||
alias: 'srz',
|
||||
describe: 'Get season list by series ID',
|
||||
docDescribe: 'This command is used only for crunchyroll.'
|
||||
+ '\n Requested is the ID of a show not a season.',
|
||||
docDescribe: 'Requested is the ID of a show not a season.',
|
||||
service: ['crunchy'],
|
||||
type: 'string',
|
||||
usage: '${ID}'
|
||||
|
|
|
|||
Loading…
Reference in a new issue