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/.idea/ani-cli-npm.iml +11 -11
- package/.idea/discord.xml +6 -6
- package/.idea/jsLibraryMappings.xml +5 -5
- package/.idea/modules.xml +7 -7
- package/.idea/vcs.xml +5 -5
- package/README.MD +77 -77
- package/bin/Anime.js +393 -393
- package/bin/core_utils/curl.js +35 -35
- package/bin/core_utils/interfaces.js +2 -2
- package/bin/core_utils/libs.js +12 -12
- package/bin/core_utils/regex.js +8 -8
- package/bin/download.js +36 -36
- package/bin/file_managment/cache.js +87 -87
- package/bin/file_managment/change_config.js +121 -121
- package/bin/file_managment/load_config.js +110 -110
- package/bin/generate_link.js +47 -47
- package/bin/help.js +59 -59
- package/bin/index.js +159 -159
- package/bin/input.js +89 -89
- package/bin/search_anime.js +39 -39
- package/package.json +45 -45
- package/tsconfig.json +109 -109
- package/.idea/git_toolbox_prj.xml +0 -15
- package/.idea/inspectionProfiles/Project_Default.xml +0 -10
- package/bin/cache.js +0 -79
- package/bin/change_config.js +0 -99
- package/bin/curl.js +0 -35
- package/bin/interfaces.js +0 -2
- package/bin/libs.js +0 -12
- package/bin/load_config.js +0 -106
- package/bin/regex.js +0 -8
- package/bin/video_quality.js +0 -6
package/bin/load_config.js
DELETED
@@ -1,106 +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.make_config_dir = exports.write_config = exports.load_config = void 0;
|
27
|
-
const fs = __importStar(require("fs"));
|
28
|
-
function make_config_dir(cache_dir, debug) {
|
29
|
-
try {
|
30
|
-
if (!fs.existsSync(cache_dir + "/"))
|
31
|
-
fs.mkdirSync(cache_dir + "/");
|
32
|
-
}
|
33
|
-
catch {
|
34
|
-
if (debug) {
|
35
|
-
console.log("Failed to make cache dir");
|
36
|
-
}
|
37
|
-
}
|
38
|
-
}
|
39
|
-
exports.make_config_dir = make_config_dir;
|
40
|
-
function write_config(cache_dir, config) {
|
41
|
-
try {
|
42
|
-
//make_config_dir(cache_dir, config.debug_mode)
|
43
|
-
fs.writeFileSync(cache_dir + "/config.conf", JSON.stringify(config), "utf-8");
|
44
|
-
}
|
45
|
-
catch {
|
46
|
-
console.log(("Failed to write to config file."));
|
47
|
-
}
|
48
|
-
}
|
49
|
-
exports.write_config = write_config;
|
50
|
-
function load_config(cache_dir) {
|
51
|
-
let config = {
|
52
|
-
player: "BROWSER",
|
53
|
-
proxy: "",
|
54
|
-
user_agent: "Mozilla/5.0 (X11; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/100.0",
|
55
|
-
most_recent: {
|
56
|
-
episode_number: 0,
|
57
|
-
anime_id: ""
|
58
|
-
},
|
59
|
-
download_folder: ".",
|
60
|
-
debug_mode: false,
|
61
|
-
mpv_socket_path: "",
|
62
|
-
vlc_socket: 0,
|
63
|
-
vlc_pass: "",
|
64
|
-
w2g_api_key: ""
|
65
|
-
};
|
66
|
-
if (fs.existsSync(cache_dir + "/config.conf")) {
|
67
|
-
// @ts-ignore
|
68
|
-
let tmp = JSON.parse(fs.readFileSync(cache_dir + "/config.conf"), "utf8");
|
69
|
-
// @ts-ignore
|
70
|
-
if (tmp.player !== undefined)
|
71
|
-
config.player = tmp.player;
|
72
|
-
// @ts-ignore
|
73
|
-
if (tmp.proxy !== undefined)
|
74
|
-
config.proxy = tmp.proxy;
|
75
|
-
// @ts-ignore
|
76
|
-
if (tmp.user_agent !== undefined)
|
77
|
-
config.user_agent = tmp.user_agent;
|
78
|
-
// @ts-ignore
|
79
|
-
if (tmp.most_recent !== undefined) {
|
80
|
-
// @ts-ignore
|
81
|
-
if (tmp.most_recent.episode_number !== undefined)
|
82
|
-
config.most_recent.episode_number = tmp.most_recent.episode_number;
|
83
|
-
// @ts-ignore
|
84
|
-
if (tmp.most_recent.anime_id !== undefined)
|
85
|
-
config.most_recent.anime_id = tmp.most_recent.anime_id;
|
86
|
-
}
|
87
|
-
// @ts-ignore
|
88
|
-
if (tmp.download_folder !== undefined)
|
89
|
-
config.download_folder = tmp.download_folder;
|
90
|
-
// @ts-ignore
|
91
|
-
if (tmp.mpv_socket_path !== undefined)
|
92
|
-
config.mpv_socket_path = tmp.mpv_socket_path;
|
93
|
-
// @ts-ignore
|
94
|
-
if (tmp.vlc_socket !== undefined)
|
95
|
-
config.vlc_socket = tmp.vlc_socket;
|
96
|
-
// @ts-ignore
|
97
|
-
if (tmp.vlc_pass !== undefined)
|
98
|
-
config.vlc_pass = tmp.vlc_pass;
|
99
|
-
// @ts-ignore
|
100
|
-
if (tmp.w2g_api_key !== undefined)
|
101
|
-
config.w2g_api_key = tmp.w2g_api_key;
|
102
|
-
}
|
103
|
-
write_config(cache_dir, config);
|
104
|
-
return config;
|
105
|
-
}
|
106
|
-
exports.load_config = load_config;
|
package/bin/regex.js
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.RegexParse = void 0;
|
4
|
-
function RegexParse(str, rule) {
|
5
|
-
let escapeRegex = (str) => str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
|
6
|
-
return new RegExp("^" + rule.split("*").map(escapeRegex).join(".*") + "$").test(str);
|
7
|
-
}
|
8
|
-
exports.RegexParse = RegexParse;
|