ani-cli-npm 2.1.3 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,45 +1,45 @@
1
- {
2
- "name": "ani-cli-npm",
3
- "version": "2.1.3",
4
- "description": "ani-cli tool rewritten as npm package",
5
- "main": "bin/index.js",
6
- "scripts": {
7
- "build": "tsc",
8
- "start": "node bin/index.js"
9
- },
10
- "repository": {
11
- "type": "git",
12
- "url": "https://github.com/Bumpkin-Pi/ani-cli-npm"
13
- },
14
- "homepage": "https://github.com/Bumpkin-Pi/ani-cli-npm",
15
- "keywords": [
16
- "anime",
17
- "ani-cli",
18
- "anime",
19
- "client",
20
- "weeb",
21
- "sad-weeb",
22
- "video",
23
- "download"
24
- ],
25
- "author": "bumpkin-pi",
26
- "license": "ISC",
27
- "bin": {
28
- "ani-cli-npm": "/bin/index.js"
29
- },
30
- "dependencies": {
31
- "@types/node-fetch": "^2.6.2",
32
- "appdata-path": "^1.0.0",
33
- "chalk": "^4.1.0",
34
- "download-file-with-progressbar": "^1.2.3",
35
- "media-player-controller": "^1.5.3",
36
- "node-fetch": "^2.6.6",
37
- "open": "^8.4.0",
38
- "simple-input": "^1.0.1",
39
- "typescript": "^4.9.3",
40
- "w2g-client": "^1.1.0"
41
- },
42
- "devDependencies": {
43
- "@types/node": "^18.11.9"
44
- }
45
- }
1
+ {
2
+ "name": "ani-cli-npm",
3
+ "version": "2.1.4",
4
+ "description": "ani-cli tool rewritten as npm package",
5
+ "main": "bin/index.js",
6
+ "scripts": {
7
+ "build": "tsc",
8
+ "start": "node bin/index.js"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/Bumpkin-Pi/ani-cli-npm"
13
+ },
14
+ "homepage": "https://github.com/Bumpkin-Pi/ani-cli-npm",
15
+ "keywords": [
16
+ "anime",
17
+ "ani-cli",
18
+ "anime",
19
+ "client",
20
+ "weeb",
21
+ "sad-weeb",
22
+ "video",
23
+ "download"
24
+ ],
25
+ "author": "bumpkin-pi",
26
+ "license": "ISC",
27
+ "bin": {
28
+ "ani-cli-npm": "/bin/index.js"
29
+ },
30
+ "dependencies": {
31
+ "@types/node-fetch": "^2.6.2",
32
+ "appdata-path": "^1.0.0",
33
+ "chalk": "^4.1.0",
34
+ "download-file-with-progressbar": "^1.2.3",
35
+ "media-player-controller": "^1.5.3",
36
+ "node-fetch": "^2.6.6",
37
+ "open": "^8.4.0",
38
+ "simple-input": "^1.0.1",
39
+ "w2g-client": "^1.1.0"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "^18.11.9",
43
+ "typescript": "^4.9.4"
44
+ }
45
+ }
package/tsconfig.json CHANGED
@@ -1,110 +1,110 @@
1
- {
2
- "compilerOptions": {
3
- /* Visit https://aka.ms/tsconfig to read more about this file */
4
-
5
- /* Projects */
6
- // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
- // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
- // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
- // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
- // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
- // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
-
13
- /* Language and Environment */
14
- "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
- // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
- // "jsx": "preserve", /* Specify what JSX code is generated. */
17
- // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
18
- // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
- // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20
- // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
- // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22
- // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23
- // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
- // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
- // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
-
27
- /* Modules */
28
- "module": "commonjs", /* Specify what module code is generated. */
29
- "rootDir": "./src/", /* Specify the root folder within your source files. */
30
- // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
31
- // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
- // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
- // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
- // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
35
- // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
- // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38
- "resolveJsonModule": true, /* Enable importing .json files. */
39
- // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
40
-
41
- /* JavaScript Support */
42
- // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
43
- // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
44
- // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
45
-
46
- /* Emit */
47
- // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
48
- // "declarationMap": true, /* Create sourcemaps for d.ts files. */
49
- // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
50
- // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
51
- // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
52
- "outDir": "./bin/", /* Specify an output folder for all emitted files. */
53
- // "removeComments": true, /* Disable emitting comments. */
54
- // "noEmit": true, /* Disable emitting files from a compilation. */
55
- // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
56
- // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
57
- // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
58
- // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
59
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
60
- // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
61
- // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
62
- // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
63
- // "newLine": "crlf", /* Set the newline character for emitting files. */
64
- // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
65
- // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
66
- // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
67
- // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
68
- // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
69
- // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
70
-
71
- /* Interop Constraints */
72
- // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
73
- // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
74
- "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
75
- // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
76
- "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
77
-
78
- /* Type Checking */
79
- "strict": true, /* Enable all strict type-checking options. */
80
- // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
81
- // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
82
- // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
83
- // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
84
- // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
85
- // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
86
- // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
87
- // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
88
- // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
89
- // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
90
- // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
91
- // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
92
- // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
93
- // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
94
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
95
- // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
96
- // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
97
- // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
98
-
99
- /* Completeness */
100
- // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
101
- "skipLibCheck": true /* Skip type checking all .d.ts files. */
102
- },
103
- "include": [
104
- "src/**/*"
105
- ],
106
- "exclude": [
107
- "node_modules",
108
- "dist"
109
- ]
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig to read more about this file */
4
+
5
+ /* Projects */
6
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
+
13
+ /* Language and Environment */
14
+ "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
+ // "jsx": "preserve", /* Specify what JSX code is generated. */
17
+ // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
18
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
+
27
+ /* Modules */
28
+ "module": "commonjs", /* Specify what module code is generated. */
29
+ "rootDir": "./src/", /* Specify the root folder within your source files. */
30
+ // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
31
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
35
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38
+ "resolveJsonModule": true, /* Enable importing .json files. */
39
+ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
40
+
41
+ /* JavaScript Support */
42
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
43
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
44
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
45
+
46
+ /* Emit */
47
+ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
48
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
49
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
50
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
51
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
52
+ "outDir": "./bin/", /* Specify an output folder for all emitted files. */
53
+ // "removeComments": true, /* Disable emitting comments. */
54
+ // "noEmit": true, /* Disable emitting files from a compilation. */
55
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
56
+ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
57
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
58
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
59
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
60
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
61
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
62
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
63
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
64
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
65
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
66
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
67
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
68
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
69
+ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
70
+
71
+ /* Interop Constraints */
72
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
73
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
74
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
75
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
76
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
77
+
78
+ /* Type Checking */
79
+ "strict": true, /* Enable all strict type-checking options. */
80
+ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
81
+ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
82
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
83
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
84
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
85
+ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
86
+ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
87
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
88
+ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
89
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
90
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
91
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
92
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
93
+ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
94
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
95
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
96
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
97
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
98
+
99
+ /* Completeness */
100
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
101
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
102
+ },
103
+ "include": [
104
+ "src/**/*"
105
+ ],
106
+ "exclude": [
107
+ "node_modules",
108
+ "dist"
109
+ ]
110
110
  }
@@ -1,15 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="GitToolBoxProjectSettings">
4
- <option name="commitMessageIssueKeyValidationOverride">
5
- <BoolValueOverride>
6
- <option name="enabled" value="true" />
7
- </BoolValueOverride>
8
- </option>
9
- <option name="commitMessageValidationEnabledOverride">
10
- <BoolValueOverride>
11
- <option name="enabled" value="true" />
12
- </BoolValueOverride>
13
- </option>
14
- </component>
15
- </project>
@@ -1,10 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
5
- <Languages>
6
- <language minSize="76" name="JavaScript" />
7
- </Languages>
8
- </inspection_tool>
9
- </profile>
10
- </component>
package/bin/cache.js DELETED
@@ -1,79 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.search_cache = exports.new_cache = exports.clear_cache = void 0;
27
- const fs = __importStar(require("fs"));
28
- function clear_cache(location, show) {
29
- try {
30
- console.log("ye sorry that doesnt exist yet.");
31
- if (show) {
32
- console.log("Cleared cache");
33
- }
34
- }
35
- catch {
36
- if (show) {
37
- console.log("Failed to clear cache.");
38
- }
39
- }
40
- }
41
- exports.clear_cache = clear_cache;
42
- function new_cache(location, anime) {
43
- /*
44
- Creates cache of Anime object, in cache file.
45
- */
46
- try {
47
- fs.writeFileSync(location + "/" + anime.id + ".cache", JSON.stringify(anime));
48
- }
49
- catch {
50
- console.log("Failed to write to cache");
51
- }
52
- }
53
- exports.new_cache = new_cache;
54
- function get_cache(location, anime_id) {
55
- /*
56
- ## Get cache by anime_id. Does not check if the cache exists.
57
- */
58
- return JSON.parse(fs.readFileSync(location + "/" + anime_id + ".cache").toString());
59
- }
60
- function search_cache(cache_folder, anime_id) {
61
- /*
62
- ## Searches cache folder for cache file with name of anime_id, at the location of cache_folder
63
-
64
- ### returns boolean for weather it is found.
65
- */
66
- try {
67
- if (check_cache(cache_folder, anime_id)) {
68
- return get_cache(cache_folder, anime_id);
69
- }
70
- return false;
71
- }
72
- catch {
73
- return false;
74
- }
75
- }
76
- exports.search_cache = search_cache;
77
- function check_cache(location, anime_id) {
78
- return fs.readdirSync(location).includes(anime_id + ".cache");
79
- }
@@ -1,99 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.config_ = void 0;
4
- const chalk = require("chalk");
5
- const input_1 = require("./input");
6
- const configs = [
7
- (async (temp) => {
8
- temp.player = [
9
- "VLC",
10
- "BROWSER",
11
- "MPV",
12
- "W2G",
13
- "LINK",
14
- ][await (0, input_1.selection)([
15
- "VLC - VLC media player",
16
- "Browser - Play in default browser",
17
- "MPV - MPV media player",
18
- "w2g.tv - Watch together with friends in browser (Specify api token to create rooms linked to your account)",
19
- "Link - Simply display the link in console"
20
- ], [], ((item) => { return chalk.cyan(item); }), ((item) => { return chalk.cyan(item); }))];
21
- // @ts-ignore
22
- return temp, 0;
23
- }),
24
- (async (temp) => {
25
- console.log(chalk.cyan("New Proxy;"));
26
- temp.proxy = (await ((0, input_1.input)())).replaceAll(" ", "");
27
- // @ts-ignore
28
- return temp, 0;
29
- }),
30
- (async (temp) => {
31
- console.log(chalk.cyan("New User Agent"));
32
- temp.user_agent = await ((0, input_1.input)());
33
- // @ts-ignore
34
- return temp, 0;
35
- }),
36
- (async (temp) => {
37
- console.log(chalk.cyan("New Downloads Folder"));
38
- temp.download_folder = await ((0, input_1.input)());
39
- // @ts-ignore
40
- return temp, 0;
41
- }),
42
- (async (temp) => {
43
- console.log(chalk.cyan("New socket file"));
44
- temp.mpv_socket_path = await ((0, input_1.input)());
45
- // @ts-ignore
46
- return temp, 0;
47
- }),
48
- (async (temp) => {
49
- console.log(chalk.cyan("New VLC socket"));
50
- temp.vlc_socket = await ((0, input_1.input)());
51
- // @ts-ignore
52
- return temp, 0;
53
- }),
54
- (async (temp) => {
55
- console.log(chalk.cyan("New VLC password"));
56
- temp.vlc_pass = await ((0, input_1.input)());
57
- // @ts-ignore
58
- return temp, 0;
59
- }),
60
- (async (temp) => {
61
- console.log(chalk.cyan("New w2g.tv api token"));
62
- temp.w2g_api_key = await ((0, input_1.input)());
63
- // @ts-ignore
64
- return temp, 0;
65
- }),
66
- (async (temp) => {
67
- // @ts-ignore
68
- return temp, 1;
69
- }),
70
- (async (temp) => {
71
- // @ts-ignore
72
- return temp, 2;
73
- })
74
- ];
75
- async function config_(temp) {
76
- /*
77
- ## Lets user change a single attribute of config. Returns new config object, and an exit code
78
-
79
- ### 0 to continue (generic return)
80
- ### 1 To confirm (Save and exit)
81
- ### 2 to cancel (exit without saving changes)
82
- */
83
- console.clear();
84
- console.log(chalk.blue("ANI-CLI-NPM \n"));
85
- console.log(chalk.yellow("Config:\n"));
86
- return configs[await (0, input_1.selection)([
87
- "Player; " + temp.player,
88
- "Proxy; " + temp.proxy,
89
- "User agent; " + temp.user_agent,
90
- "Downloads folder; " + temp.download_folder,
91
- "Mpv socket connection file; " + temp.mpv_socket_path,
92
- "VLC socket; " + temp.vlc_socket,
93
- "VLC pass; " + temp.vlc_pass,
94
- "W2G api token: " + temp.w2g_api_key,
95
- "Save and exit",
96
- "Exit without saving"
97
- ], [], ((item) => { return chalk.cyan(item); }), ((item) => { return chalk.cyan(item); }))](temp);
98
- }
99
- exports.config_ = config_;
package/bin/curl.js DELETED
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.curl = void 0;
4
- const fetch = require("node-fetch");
5
- const chalk = require("chalk");
6
- async function curl(url, method = "GET", redirect = false) {
7
- try {
8
- let response = await fetch(url, {
9
- //"agent": proxyAgent,
10
- "headers": {
11
- 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/100.0',
12
- "X-Requested-With": "XMLHttpRequest"
13
- },
14
- "referrerPolicy": "origin",
15
- "body": null,
16
- "method": method,
17
- "redirect": 'follow',
18
- // "follow": 10,
19
- }).catch(async function (err) {
20
- console.warn(chalk.red(`Something went wrong connecting to ${url}. ${err}`));
21
- process.exit();
22
- });
23
- if (redirect) {
24
- return response.url;
25
- }
26
- else {
27
- return await response.text();
28
- }
29
- }
30
- catch {
31
- console.log(chalk.red("Something went wrong in curl()"));
32
- process.exit();
33
- }
34
- }
35
- exports.curl = curl;
package/bin/interfaces.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
package/bin/libs.js DELETED
@@ -1,12 +0,0 @@
1
- "use strict";
2
- // Random functions
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.range = void 0;
5
- function range(start, end) {
6
- let ans = [];
7
- for (let i = start; i <= end; i++) {
8
- ans.push(i);
9
- }
10
- return ans;
11
- }
12
- exports.range = range;