From cb346284bac12b24d3e2342d117e2dd453c12d33 Mon Sep 17 00:00:00 2001 From: Izuco Date: Sat, 20 Nov 2021 15:12:10 +0100 Subject: [PATCH 1/7] Funimation but && crunchyroll all --- crunchy.ts | 6 +++--- funi.ts | 2 +- index.ts | 5 +++++ modules/module.app-args.ts | 10 ++++++++-- modules/module.parseSelect.ts | 11 ++++++----- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/crunchy.ts b/crunchy.ts index 67794e17..85b7612d 100644 --- a/crunchy.ts +++ b/crunchy.ts @@ -94,8 +94,8 @@ export default (async () => { await refreshToken(); if (argv.dubLang.length > 1) { console.log('[INFO] One show can only be downloaded with one dub. Use --srz instead.'); - argv.dubLang = argv.dubLang[0]; } + argv.dubLang = argv.dubLang[0]; await getSeasonById(); } else if(argv.e){ @@ -699,7 +699,7 @@ async function getSeasonById(){ ? 'S' + epNumList.sp.toString().padStart(epNumLen['S'], '0') : '' + parseInt(epNum, 10).toString().padStart(epNumLen['E'], '0') ); - if(selEps.indexOf(selEpId) > -1 && !item.isSelected && item.playback){ + if((argv.all && item.playback) || (selEps.indexOf(selEpId) > -1 && !item.isSelected && item.playback)){ selectedMedia.push(epMeta); item.isSelected = true; } @@ -1315,7 +1315,7 @@ const itemSelectMultiDub = (eps: Record -1 && item.playback){ + if((argv.all || selEps.indexOf(selEpId) > -1) && item.playback){ if (Object.prototype.hasOwnProperty.call(ret, key)) { const epMe = ret[key]; epMe.data.push({ diff --git a/funi.ts b/funi.ts index 080a4cc6..1ec58eb7 100644 --- a/funi.ts +++ b/funi.ts @@ -209,7 +209,7 @@ async function getShow(){ return e; }); - const epSelList = parseSelect(argv.e as string); + const epSelList = parseSelect(argv.e as string, argv.but); const fnSlug: { title: string, diff --git a/index.ts b/index.ts index 0ad8e726..faef3f47 100644 --- a/index.ts +++ b/index.ts @@ -10,6 +10,11 @@ import update from './modules/module.updater'; await update(argv.update); + if (argv.all && argv.but) { + console.log('[ERROR] --all and --but exclude each other!') + return; + } + if (argv.service === 'funi') { (await import('./funi')).default(); } else if (argv.service === 'crunchy') { diff --git a/modules/module.app-args.ts b/modules/module.app-args.ts index 70f96bd5..951bd3fb 100644 --- a/modules/module.app-args.ts +++ b/modules/module.app-args.ts @@ -34,7 +34,7 @@ export type possibleSubs = ( )[]; const subLang: possibleSubs = ['enUS', 'esLA', 'ptBR']; const dubLang: possibleDubs = ['enUS', 'esLA', 'ptBR', 'zhMN', 'jaJP']; -let argvC: { [x: string]: unknown; auth: boolean | undefined; dlFonts: boolean | undefined; search: string | undefined; 'search-type': string; page: number | undefined; 'search-locale': string; new: boolean | undefined; 'movie-listing': string | undefined; series: string | undefined; s: string | undefined; e: string | undefined; q: number; x: number; kstream: number; partsize: number; hslang: string; subLang: string[]; dlsubs: string | string[]; novids: boolean | undefined; noaudio: boolean | undefined; nosubs: boolean | undefined; dub: possibleDubs; dubLang: string; all: boolean; fontSize: number; allSubs: boolean; allDubs: boolean; timeout: number; simul: boolean; mp4: boolean; skipmux: boolean | undefined; fileName: string; numbers: number; nosess: string; debug: boolean | undefined; nocleanup: boolean; help: boolean | undefined; service: 'funi' | 'crunchy'; update: boolean; fontName: string | undefined; _: (string | number)[]; $0: string; }; +let argvC: { [x: string]: unknown; but: boolean, auth: boolean | undefined; dlFonts: boolean | undefined; search: string | undefined; 'search-type': string; page: number | undefined; 'search-locale': string; new: boolean | undefined; 'movie-listing': string | undefined; series: string | undefined; s: string | undefined; e: string | undefined; q: number; x: number; kstream: number; partsize: number; hslang: string; subLang: string[]; dlsubs: string | string[]; novids: boolean | undefined; noaudio: boolean | undefined; nosubs: boolean | undefined; dub: possibleDubs; dubLang: string; all: boolean; fontSize: number; allSubs: boolean; allDubs: boolean; timeout: number; simul: boolean; mp4: boolean; skipmux: boolean | undefined; fileName: string; numbers: number; nosess: string; debug: boolean | undefined; nocleanup: boolean; help: boolean | undefined; service: 'funi' | 'crunchy'; update: boolean; fontName: string | undefined; _: (string | number)[]; $0: string; }; const appArgv = (cfg: { [key: string]: unknown @@ -199,7 +199,7 @@ const appArgv = (cfg: { }) .option('all', { group: groups.dl, - describe: 'Used to download all episodes from the show (Funi only)', + describe: 'Used to download all episodes from the show', type: 'boolean', default: parseDefault('all', false) }) @@ -299,6 +299,12 @@ const appArgv = (cfg: { type: 'string', default: parseDefault('fontName', undefined) }) + .option('but', { + group: groups.dl, + describe: 'Download everything but', + type: 'boolean', + default: false + }) .parseSync(); argvC = argv; return argv; diff --git a/modules/module.parseSelect.ts b/modules/module.parseSelect.ts index 2bcf5a32..cf6b2771 100644 --- a/modules/module.parseSelect.ts +++ b/modules/module.parseSelect.ts @@ -1,11 +1,11 @@ -const parseSelect = (selectString: string) : { +const parseSelect = (selectString: string, but = false) : { isSelected: (val: string) => boolean, values: string[] } => { if (!selectString) return { values: [], - isSelected: () => false + isSelected: () => but }; const parts = selectString.split(','); const select: string[] = []; @@ -82,10 +82,11 @@ const parseSelect = (selectString: string) : { if (isNaN(number)) { return false; } - - return select.includes(`${letter}${number}`); + const included = select.includes(`${letter}${number}`); + return but ? !included : included } else { - return select.includes(`${parseInt(st)}`); + const included = select.includes(`${parseInt(st)}`); + return but ? !included : included } } }; From 72a38b975b8883986723fd28405f3946b861da0a Mon Sep 17 00:00:00 2001 From: Izuco Date: Sat, 20 Nov 2021 15:28:20 +0100 Subject: [PATCH 2/7] Crunchy but --- crunchy.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crunchy.ts b/crunchy.ts index 85b7612d..3bf0cce6 100644 --- a/crunchy.ts +++ b/crunchy.ts @@ -699,7 +699,7 @@ async function getSeasonById(){ ? 'S' + epNumList.sp.toString().padStart(epNumLen['S'], '0') : '' + parseInt(epNum, 10).toString().padStart(epNumLen['E'], '0') ); - if((argv.all && item.playback) || (selEps.indexOf(selEpId) > -1 && !item.isSelected && item.playback)){ + if((argv.but && item.playback && selEps.indexOf(selEpId) == -1) || (argv.all && item.playback) || (!argv.but && selEps.indexOf(selEpId) > -1 && !item.isSelected && item.playback)){ selectedMedia.push(epMeta); item.isSelected = true; } @@ -1315,7 +1315,7 @@ const itemSelectMultiDub = (eps: Record -1) && item.playback){ + if((argv.but && selEps.indexOf(selEpId) == -1) || (argv.all || (selEps.indexOf(selEpId) > -1) && item.playback && !argv.but)){ if (Object.prototype.hasOwnProperty.call(ret, key)) { const epMe = ret[key]; epMe.data.push({ From 9586b412a1e442bad01b7c55092716415ce54773 Mon Sep 17 00:00:00 2001 From: Izuco Date: Sat, 20 Nov 2021 15:28:44 +0100 Subject: [PATCH 3/7] Style --- index.ts | 2 +- modules/module.parseSelect.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.ts b/index.ts index faef3f47..0c3d4a45 100644 --- a/index.ts +++ b/index.ts @@ -11,7 +11,7 @@ import update from './modules/module.updater'; await update(argv.update); if (argv.all && argv.but) { - console.log('[ERROR] --all and --but exclude each other!') + console.log('[ERROR] --all and --but exclude each other!'); return; } diff --git a/modules/module.parseSelect.ts b/modules/module.parseSelect.ts index cf6b2771..c517493a 100644 --- a/modules/module.parseSelect.ts +++ b/modules/module.parseSelect.ts @@ -83,10 +83,10 @@ const parseSelect = (selectString: string, but = false) : { return false; } const included = select.includes(`${letter}${number}`); - return but ? !included : included + return but ? !included : included; } else { const included = select.includes(`${parseInt(st)}`); - return but ? !included : included + return but ? !included : included; } } }; From 8f6dcbed0f7400c84325d259d0bb7ec58b5b4dfe Mon Sep 17 00:00:00 2001 From: Izuco Date: Sun, 21 Nov 2021 14:53:14 +0100 Subject: [PATCH 4/7] Download Archve --- .gitignore | 3 +- config/cli-defaults.yml | 6 +- crunchy.ts | 25 +++++-- funi.ts | 60 ++++++++++------ index.ts | 47 +++++++++++-- modules/module.app-args.ts | 67 +++++++++++++----- modules/module.downloadArchive.ts | 109 ++++++++++++++++++++++++++++++ 7 files changed, 266 insertions(+), 51 deletions(-) create mode 100644 modules/module.downloadArchive.ts diff --git a/.gitignore b/.gitignore index f856a9d1..c0cc86d1 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,5 @@ token.yml lib test.* updates.json -cr_token.yml \ No newline at end of file +cr_token.yml +archive.json \ No newline at end of file diff --git a/config/cli-defaults.yml b/config/cli-defaults.yml index bb517a47..4359f154 100644 --- a/config/cli-defaults.yml +++ b/config/cli-defaults.yml @@ -1,4 +1,6 @@ -videoLayer: 7 +videoLayer: 1 nServer: 1 mp4mux: false -noCleanUp: false \ No newline at end of file +noCleanUp: false +partsize: 50 +timeout: 30000 \ No newline at end of file diff --git a/crunchy.ts b/crunchy.ts index 3bf0cce6..ba7268f9 100644 --- a/crunchy.ts +++ b/crunchy.ts @@ -55,6 +55,7 @@ import { CrunchyEpMeta, CrunchyEpMetaMultiDub, ParseItem, SeriesSearch, SeriesSe import { ObjectInfo } from './@types/objectInfo'; import parseFileName, { Variable } from './modules/module.filename'; import { PlaybackData } from './@types/playbackData'; +import { downloaded } from './modules/module.downloadArchive'; const req = new reqModule.Req(domain, argv); // select @@ -84,7 +85,7 @@ export default (async () => { else if(argv.series && argv.series.match(/^[0-9A-Z]{9}$/)){ await refreshToken(); await getSeriesById(); - await downloadFromSeriesID(); + return await downloadFromSeriesID(); } else if(argv['movie-listing'] && argv['movie-listing'].match(/^[0-9A-Z]{9}$/)){ await refreshToken(); @@ -96,7 +97,7 @@ export default (async () => { console.log('[INFO] One show can only be downloaded with one dub. Use --srz instead.'); } argv.dubLang = argv.dubLang[0]; - await getSeasonById(); + return await getSeasonById(); } else if(argv.e){ await refreshToken(); @@ -719,10 +720,18 @@ async function getSeasonById(){ } console.log(); + let ok = true; for(const media of selectedMedia){ - await getMedia(media); + if (await getMedia(media) !== true) { + ok = false; + } else { + downloaded({ + service: 'crunchy', + type: 's' + }, argv.s as string, [media.episodeNumber]); + } } - + return ok; } async function getObjectById(returnData?: boolean){ @@ -1164,7 +1173,8 @@ async function getMedia(mMeta: CrunchyEpMeta){ else{ console.log(); } - + + return !dlFailed; } async function muxStreams(options: MergerOptions){ @@ -1247,6 +1257,10 @@ const downloadFromSeriesID = async () => { const res = await getMediaList(item); if (!res) return; + downloaded({ + service: 'crunchy', + type: 'srz' + }, argv.series as string, [item.episodeNumber]); muxStreams({ onlyAudio: [], onlyVid: [], @@ -1262,6 +1276,7 @@ const downloadFromSeriesID = async () => { fonts: Merger.makeFontsList(cfg.dir.fonts, appstore.sxList) }); } + return true; }; const itemSelectMultiDub = (eps: Record { searchShow(); } else if(argv.s && !isNaN(parseInt(argv.s)) && parseInt(argv.s) > 0){ - getShow(); + return getShow(); } else{ appYargs.showHelp(); @@ -134,7 +134,7 @@ async function searchShow(){ // get show async function getShow(){ - // show main data + let ok = true; const showData = await getData({ baseUrl: api_host, url: `/source/catalog/title/${argv.s}`, @@ -213,7 +213,8 @@ async function getShow(){ const fnSlug: { title: string, - episode: string + episode: string, + episodeID: string }[] = []; let is_selected = false; const eps = epsDataArr; @@ -233,7 +234,7 @@ async function getShow(){ // select is_selected = false; if (argv.all || epSelList.isSelected(epStrId)) { - fnSlug.push({title:eps[e].item.titleSlug,episode:eps[e].item.episodeSlug}); + fnSlug.push({title:eps[e].item.titleSlug,episode:eps[e].item.episodeSlug, episodeID:epStrId}); epSelEpsTxt.push(epStrId); is_selected = true; } @@ -265,15 +266,17 @@ async function getShow(){ else{ console.log('[INFO] Selected Episodes: %s\n',epSelEpsTxt.join(', ')); for(let fnEp=0;fnEp fs.unlinkSync(a.path)); stDlPath.forEach(subObject => subObject.file && fs.unlinkSync(subObject.file)); console.log('\n[INFO] Done!\n'); + downloaded({ + service: 'funi', + type: 's' + }, argv.s as string, [epsiodeID]); + return true; } async function downloadFile(filename: string, chunkList: { diff --git a/index.ts b/index.ts index 0c3d4a45..82ecf5d4 100644 --- a/index.ts +++ b/index.ts @@ -1,5 +1,6 @@ -import { appArgv } from './modules/module.app-args'; +import { appArgv, overrideArguments } from './modules/module.app-args'; import * as yamlCfg from './modules/module.cfg-loader'; +import { makeCommand, downloaded, addToArchive } from './modules/module.downloadArchive'; import update from './modules/module.updater'; @@ -14,11 +15,43 @@ import update from './modules/module.updater'; console.log('[ERROR] --all and --but exclude each other!'); return; } - - if (argv.service === 'funi') { - (await import('./funi')).default(); - } else if (argv.service === 'crunchy') { - (await import('./crunchy')).default(); - } + if (argv.addArchive) { + if (argv.service === 'funi') { + if (argv.s === undefined) + return console.log('[ERROR] `-s` not found'); + addToArchive({ + service: 'funi', + type: 's' + }, argv.s); + console.log('[INFO] Added %s to the downloadArchive list', argv.s); + } else if (argv.service === 'crunchy') { + if (argv.s === undefined && argv.series === undefined) + return console.log('[ERROR] `-s` or `--srz` not found'); + if (argv.s && argv.series) + return console.log('[ERROR] Both `-s` and `--srz` found'); + addToArchive({ + service: 'crunchy', + type: argv.s === undefined ? 'srz' : 's' + }, (argv.s === undefined ? argv.series : argv.s) as string); + console.log('[INFO] Added %s to the downloadArchive list', (argv.s === undefined ? argv.series : argv.s)); + } + } else if (argv.downloadArchive) { + const ids = makeCommand(argv.service); + for (const id of ids) { + overrideArguments(cfg.cli, id); + /* Reimport module to override appArgv */ + Object.keys(require.cache).forEach(key => { + if (key.endsWith('crunchy.js') || key.endsWith('funi.js')) + delete require.cache[key] + }) + await (argv.service === 'funi' ? await import('./funi') : await import('./crunchy')).default(); + } + } else { + if (argv.service === 'funi') { + (await import('./funi')).default(); + } else if (argv.service === 'crunchy') { + (await import('./crunchy')).default(); + } + } })(); \ No newline at end of file diff --git a/modules/module.app-args.ts b/modules/module.app-args.ts index 951bd3fb..59eb56bb 100644 --- a/modules/module.app-args.ts +++ b/modules/module.app-args.ts @@ -27,27 +27,58 @@ const availableFilenameVars: AvailableFilenameVars[] = [ ]; export type possibleDubs = ( - 'enUS' | 'esLA' | 'ptBR' | 'zhMN' | 'jaJP' -)[]; + 'enUS' | 'esLA' | 'ptBR' | 'zhMN' | 'jaJP' + )[]; export type possibleSubs = ( 'enUS' | 'esLA' | 'ptBR' -)[]; + )[]; const subLang: possibleSubs = ['enUS', 'esLA', 'ptBR']; const dubLang: possibleDubs = ['enUS', 'esLA', 'ptBR', 'zhMN', 'jaJP']; -let argvC: { [x: string]: unknown; but: boolean, auth: boolean | undefined; dlFonts: boolean | undefined; search: string | undefined; 'search-type': string; page: number | undefined; 'search-locale': string; new: boolean | undefined; 'movie-listing': string | undefined; series: string | undefined; s: string | undefined; e: string | undefined; q: number; x: number; kstream: number; partsize: number; hslang: string; subLang: string[]; dlsubs: string | string[]; novids: boolean | undefined; noaudio: boolean | undefined; nosubs: boolean | undefined; dub: possibleDubs; dubLang: string; all: boolean; fontSize: number; allSubs: boolean; allDubs: boolean; timeout: number; simul: boolean; mp4: boolean; skipmux: boolean | undefined; fileName: string; numbers: number; nosess: string; debug: boolean | undefined; nocleanup: boolean; help: boolean | undefined; service: 'funi' | 'crunchy'; update: boolean; fontName: string | undefined; _: (string | number)[]; $0: string; }; +let argvC: { [x: string]: unknown; downloadArchive: boolean, addArchive: boolean, but: boolean, auth: boolean | undefined; dlFonts: boolean | undefined; search: string | undefined; 'search-type': string; page: number | undefined; 'search-locale': string; new: boolean | undefined; 'movie-listing': string | undefined; series: string | undefined; s: string | undefined; e: string | undefined; q: number; x: number; kstream: number; partsize: number; hslang: string; subLang: string[]; dlsubs: string | string[]; novids: boolean | undefined; noaudio: boolean | undefined; nosubs: boolean | undefined; dub: possibleDubs; dubLang: string; all: boolean; fontSize: number; allSubs: boolean; allDubs: boolean; timeout: number; simul: boolean; mp4: boolean; skipmux: boolean | undefined; fileName: string; numbers: number; nosess: string; debug: boolean | undefined; nocleanup: boolean; help: boolean | undefined; service: 'funi' | 'crunchy'; update: boolean; fontName: string | undefined; _: (string | number)[]; $0: string; }; + +export type ArgvType = typeof argvC; const appArgv = (cfg: { [key: string]: unknown }) => { if (argvC) return argvC; + const argv = getArgv(cfg) + .parseSync(); + argvC = argv; + return argv; +}; + + +const overrideArguments = (cfg: { [key:string]: unknown }, override: Partial) => { + const argv = getArgv(cfg).middleware((ar) => { + for (const key of Object.keys(override)) { + ar[key] = override[key]; + } + return ar; + }).parseSync(); + argvC = argv; +}; + +const showHelp = yargs.showHelp; + +export { + appArgv, + showHelp, + availableFilenameVars, + subLang, + dubLang, + overrideArguments +}; + +const getArgv = (cfg: { [key:string]: unknown }) => { const parseDefault = (key: string, _default: T) : T=> { if (Object.prototype.hasOwnProperty.call(cfg, key)) { return cfg[key] as T; } else return _default; }; - + const argv = yargs.parserConfiguration({ 'duplicate-arguments-array': false, 'camel-case-expansion': false, @@ -305,17 +336,19 @@ const appArgv = (cfg: { type: 'boolean', default: false }) - .parseSync(); - argvC = argv; + .option('downloadArchive', { + group: groups.dl, + desc: 'Used to download all archived shows', + type: 'boolean', + default: false + }) + .option('addArchive', { + group: groups.dl, + desc: 'Used to add the `-s` and `--srz` to downloadArchive', + type: 'boolean', + default: false + }); return argv; }; - -const showHelp = yargs.showHelp; - -export { - appArgv, - showHelp, - availableFilenameVars, - subLang, - dubLang -}; \ No newline at end of file + + \ No newline at end of file diff --git a/modules/module.downloadArchive.ts b/modules/module.downloadArchive.ts new file mode 100644 index 00000000..b882472d --- /dev/null +++ b/modules/module.downloadArchive.ts @@ -0,0 +1,109 @@ +import * as path from 'path'; +import * as fs from 'fs'; +import { ArgvType } from './module.app-args'; + +const workingDir = (process as NodeJS.Process & { + pkg?: unknown +}).pkg ? path.dirname(process.execPath) : path.join(__dirname, '/..'); +export const archiveFile = path.join(workingDir, 'config', 'archive.json'); + +export type ItemType = { + id: string, + already: string[] +}[] + +export type DataType = { + funi: { + s: ItemType + }, + crunchy: { + srz: ItemType, + s: ItemType + } +} + +const addToArchive = (kind: { + service: 'funi', + type: 's' +} | { + service: 'crunchy', + type: 's'|'srz' +}, ID: string) => { + const data = loadData(); + + if (Object.prototype.hasOwnProperty.call(data, kind.service)) { + const items = kind.service === 'crunchy' ? data[kind.service][kind.type] : data[kind.service][kind.type]; + items.push({ + id: ID, + already: [] + }); + } else { + if (kind.service === 'funi') { + data['funi'] = { + s: [ + { + id: ID, + already: [] + } + ] + }; + } else { + data['crunchy'] = { + s: ([] as ItemType).concat(kind.type === 's' ? { + id: ID, + already: [] as string[] + } : []), + srz: ([] as ItemType).concat(kind.type === 'srz' ? { + id: ID, + already: [] as string[] + } : []), + }; + } + } + fs.writeFileSync(archiveFile, JSON.stringify(data, null, 4)); +}; + +const downloaded = (kind: { + service: 'funi', + type: 's' +} | { + service: 'crunchy', + type: 's'|'srz' +}, ID: string, episode: string[]) => { + const data = loadData(); + if (!Object.prototype.hasOwnProperty.call(data, kind.service)) + addToArchive(kind, ID); + (kind.service == 'crunchy' ? data[kind.service][kind.type] : data[kind.service][kind.type]).find(a => a.id === ID)?.already.push(...episode); + fs.writeFileSync(archiveFile, JSON.stringify(data, null, 4)); +}; + +const makeCommand = (service: 'funi'|'crunchy') : Partial[] => { + const data = loadData(); + const ret: Partial[] = []; + const kind = data[service]; + for (const type of Object.keys(kind)) { + const item = kind[type as 's']; // 'srz' is also possible but will be ignored for the compiler + item.forEach(i => ret.push({ + but: true, + all: false, + service, + e: i.already.join(','), + ...(type === 's' ? { + s: i.id, + series: undefined + } : { + series: i.id, + s: undefined + }) + })); + } + return ret; +}; + +const loadData = () : DataType => { + if (fs.existsSync(archiveFile)) + return JSON.parse(fs.readFileSync(archiveFile).toString()) as DataType; + return {} as DataType; +}; + +export { addToArchive, downloaded, makeCommand }; \ No newline at end of file From 0cef1d95ee9009d9677224798eef485fe0cf9466 Mon Sep 17 00:00:00 2001 From: Izuco Date: Sun, 21 Nov 2021 14:53:50 +0100 Subject: [PATCH 5/7] Style --- index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.ts b/index.ts index 82ecf5d4..891a2b99 100644 --- a/index.ts +++ b/index.ts @@ -1,6 +1,6 @@ import { appArgv, overrideArguments } from './modules/module.app-args'; import * as yamlCfg from './modules/module.cfg-loader'; -import { makeCommand, downloaded, addToArchive } from './modules/module.downloadArchive'; +import { makeCommand, addToArchive } from './modules/module.downloadArchive'; import update from './modules/module.updater'; @@ -43,8 +43,8 @@ import update from './modules/module.updater'; /* Reimport module to override appArgv */ Object.keys(require.cache).forEach(key => { if (key.endsWith('crunchy.js') || key.endsWith('funi.js')) - delete require.cache[key] - }) + delete require.cache[key]; + }); await (argv.service === 'funi' ? await import('./funi') : await import('./crunchy')).default(); } } else { From a10d84ca4bbe38def06b925fd5a04ee0dbab6ff1 Mon Sep 17 00:00:00 2001 From: Izuco Date: Sun, 21 Nov 2021 14:54:35 +0100 Subject: [PATCH 6/7] Update version --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1b95359d..ed7705cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "multi-downloader-nx", - "version": "1.1.1", + "version": "2.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d8694fee..87fabfe5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "multi-downloader-nx", "short_name": "aniDL", - "version": "1.1.1", + "version": "2.0.0", "description": "Download videos from Funimation or Crunchyroll via cli", "keywords": [ "download", From e133821424fc5b1615e506712254f54e3ece8636 Mon Sep 17 00:00:00 2001 From: Izuco Date: Sun, 21 Nov 2021 14:58:25 +0100 Subject: [PATCH 7/7] Revert unintended default config changes --- config/cli-defaults.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/config/cli-defaults.yml b/config/cli-defaults.yml index 4359f154..bb517a47 100644 --- a/config/cli-defaults.yml +++ b/config/cli-defaults.yml @@ -1,6 +1,4 @@ -videoLayer: 1 +videoLayer: 7 nServer: 1 mp4mux: false -noCleanUp: false -partsize: 50 -timeout: 30000 \ No newline at end of file +noCleanUp: false \ No newline at end of file