@anjishnusengupta/ny-cli 3.0.0 → 3.0.2
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/3.0.2 +0 -0
- package/backend.mjs +37 -1
- package/install.sh +1 -1
- package/ny-cli +2 -2
- package/package.json +1 -1
package/3.0.2
ADDED
|
File without changes
|
package/backend.mjs
CHANGED
|
@@ -4,7 +4,43 @@
|
|
|
4
4
|
// No external API dependency — self-hosted, just like nyanime.tech
|
|
5
5
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import dns from "node:dns";
|
|
8
|
+
import https from "node:https";
|
|
9
|
+
import http from "node:http";
|
|
10
|
+
|
|
11
|
+
// Use public DNS (Cloudflare + Google) to bypass ISP-level domain blocking.
|
|
12
|
+
// dns.resolve{4,6} uses these servers; dns.lookup uses the OS resolver.
|
|
13
|
+
dns.setServers(["1.1.1.1", "8.8.8.8", "1.0.0.1", "8.8.4.4"]);
|
|
14
|
+
|
|
15
|
+
// Custom lookup: prefer IPv6 (bypasses SNI-based DPI blocking on many ISPs),
|
|
16
|
+
// fall back to IPv4 via dns.resolve4, then OS resolver as last resort.
|
|
17
|
+
function customLookup(hostname, options, callback) {
|
|
18
|
+
if (typeof options === "function") { callback = options; options = {}; }
|
|
19
|
+
dns.resolve6(hostname, (err6, addr6) => {
|
|
20
|
+
if (!err6 && addr6 && addr6.length > 0) {
|
|
21
|
+
if (options.all) {
|
|
22
|
+
return callback(null, addr6.map(a => ({ address: a, family: 6 })));
|
|
23
|
+
}
|
|
24
|
+
return callback(null, addr6[0], 6);
|
|
25
|
+
}
|
|
26
|
+
dns.resolve4(hostname, (err4, addr4) => {
|
|
27
|
+
if (!err4 && addr4 && addr4.length > 0) {
|
|
28
|
+
if (options.all) {
|
|
29
|
+
return callback(null, addr4.map(a => ({ address: a, family: 4 })));
|
|
30
|
+
}
|
|
31
|
+
return callback(null, addr4[0], 4);
|
|
32
|
+
}
|
|
33
|
+
dns.lookup(hostname, options, callback);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Replace global agents so ALL http/https requests use our DNS
|
|
39
|
+
http.globalAgent = new http.Agent({ lookup: customLookup });
|
|
40
|
+
https.globalAgent = new https.Agent({ lookup: customLookup });
|
|
41
|
+
|
|
42
|
+
// Dynamic import so aniwatch picks up patched global agents
|
|
43
|
+
const { HiAnime } = await import("aniwatch");
|
|
8
44
|
|
|
9
45
|
const hianime = new HiAnime.Scraper();
|
|
10
46
|
|
package/install.sh
CHANGED
|
@@ -25,7 +25,7 @@ printf " ╚═╝ ╚═══╝ ╚═╝ ╚═════╝
|
|
|
25
25
|
printf "${RESET}\n"
|
|
26
26
|
printf "${DIM}${CYAN} ⟨ Your Gateway to Anime Streaming ⟩${RESET}\n"
|
|
27
27
|
printf "${DIM} ─────────────────────────────────────${RESET}\n"
|
|
28
|
-
printf "${DIM} v3.0.
|
|
28
|
+
printf "${DIM} v3.0.2 • nyanime.tech${RESET}\n"
|
|
29
29
|
printf "\n"
|
|
30
30
|
|
|
31
31
|
REPO_URL="https://raw.githubusercontent.com/AnjishnuSengupta/ny-cli/main"
|
package/ny-cli
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# ══════════════════════════════════════════════════════════════════════════════
|
|
3
3
|
# NY-CLI - Terminal-based Anime Streaming Client
|
|
4
|
-
# Version: 3.0.
|
|
4
|
+
# Version: 3.0.2
|
|
5
5
|
# Author: Anjishnu Sengupta
|
|
6
6
|
# Website: https://nyanime.tech
|
|
7
7
|
# Repository: https://github.com/AnjishnuSengupta/ny-cli
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
# Just install and run - no external API dependency!
|
|
11
11
|
# ══════════════════════════════════════════════════════════════════════════════
|
|
12
12
|
|
|
13
|
-
VERSION="3.0.
|
|
13
|
+
VERSION="3.0.2"
|
|
14
14
|
|
|
15
15
|
# ══════════════════════════════════════════════════════════════════════════════
|
|
16
16
|
# BACKEND CONFIGURATION (Self-hosted via aniwatch npm package)
|