Browse Source

Add support for changing the batchfile on the command line

Godzil 6 years ago
parent
commit
4ee814864c
4 changed files with 238 additions and 288 deletions
  1. 225 280
      package-lock.json
  2. 7 5
      package.json
  3. 5 3
      src/batch.ts
  4. 1 0
      src/interface/IConfig.d.ts

File diff suppressed because it is too large
+ 225 - 280
package-lock.json


+ 7 - 5
package.json

@@ -21,31 +21,33 @@
     "crunchy.sh": "./bin/crunchy.sh"
   },
   "dependencies": {
-    "big-integer": "^1.6.27",
+    "big-integer": "^1.6.30",
     "bluebird": "^3.5.1",
     "cheerio": "^0.22.0",
     "cloudscraper": "^1.5.0",
     "commander": "^2.15.1",
-    "fs-extra": "^5.0.0",
+    "fs-extra": "^6.0.1",
     "mkdirp": "^0.5.0",
-    "request": "^2.85.0",
+    "request": "^2.87.0",
     "request-promise": "^4.2.2",
     "xml2js": "^0.4.5"
   },
   "devDependencies": {
     "@types/bluebird": "^3.5.20",
     "@types/cheerio": "^0.22.7",
+    "@types/fs-extra": "^5.0.2",
     "@types/mkdirp": "^0.5.2",
     "@types/request": "^2.47.0",
     "@types/request-promise": "^4.1.41",
     "@types/xml2js": "^0.4.2",
     "@types/fs-extra": "^5.0.2",
     "tsconfig-lint": "^0.12.0",
-    "tslint": "^5.9.1",
-    "typescript": "^2.8.1"
+    "tslint": "^5.10.0",
+    "typescript": "^2.9.1"
   },
   "scripts": {
     "prepublishOnly": "npm run build",
+    "compile": "tsc",
     "build": "tsc",
     "test": "tslint --project .",
     "start": "node ./bin/crunchy"

+ 5 - 3
src/batch.ts

@@ -20,7 +20,7 @@ const resol_table: { [id: string]: IResolData; } =
 export default function(args: string[], done: (err?: Error) => void)
 {
   const config = parse(args);
-  const batchPath = path.join(config.output || process.cwd(), 'CrunchyRoll.txt');
+  const batchPath = path.join(config.output || process.cwd(), config.batch);
 
   // set resolution
   if (config.resolution)
@@ -182,8 +182,10 @@ function parse(args: string[]): IConfigLine
     .option('-o, --output <s>', 'The output path.')
     .option('-s, --series <s>', 'The series override.')
     .option('-n, --filename <s>', 'The name override.')
-    .option('-t, --tag <s>', 'The subgroup. (Default: CrunchyRoll)')
-    .option('-r, --resolution <s>', 'The video resolution. (Default: 1080 (360, 480, 720, 1080))')
+    .option('-t, --tag <s>', 'The subgroup. (Default: CrunchyRoll)', 'CrunchyRoll')
+    .option('-r, --resolution <s>', 'The video resolution. (Default: 1080 (360, 480, 720, 1080))',
+            '1080')
     .option('-g, --rebuildcrp', 'Rebuild the crpersistant file.')
+    .option('-b, --batch <s>', 'Batch file', 'CrunchyRoll.txt')
     .parse(args);
 }

+ 1 - 0
src/interface/IConfig.d.ts

@@ -18,4 +18,5 @@ interface IConfig {
   video_format?: string;
   video_quality?: string;
   rebuildcrp?: boolean;
+  batch?: string;
 }

Some files were not shown because too many files changed in this diff