Skip to content

Commit 696d1b0

Browse files
author
Taois
committed
feat: 发个没啥用的新版本
1 parent 24f1748 commit 696d1b0

File tree

9 files changed

+271
-147
lines changed

9 files changed

+271
-147
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,4 @@ dist
148148
/scripts/python/XYQ提取结果.json
149149
*.pyc
150150
/scripts/python/appMap.txt
151+
/binary/

config/map.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,17 @@ AppV2²@@https://www.rebovod.com@@热剧[AV²]
4949
AppV2²@@http://v.lnhaozhenjin.cn@@好震惊[AV²]
5050
AppV2²@@http://jxfmax.juxiafan.com@@剧下饭[AV²]
5151
AppV1@@http://ziyuncms.feifan12.xyz/api.php@@紫云[AV¹]
52-
getapp3.4.2@@{"host": "https://appcms.xy4k.com", "datakey": "7SDWjknU34zqFbVr"}@@小羊4k[AG³]
53-
getapp3.4.2@@{"host": "https://jingyu4k-1312635929.cos.ap-nanjing.myqcloud.com/1.json", "datakey": "AAdgrdghjfgswerA", "api": 2}@@鲸鱼影视[AG³]
54-
getapp3.4.2@@{"host": "https://staraugust123456.oss-cn-hangzhou.aliyuncs.com/1.txt", "datakey": "staraugust123456", "api": 2}@@云云[AG³]
55-
getapp3.4.2@@{"host": "http://tengxunyunaliyun.oss-cn-shanghai.aliyuncs.com/tengxunyun.txt", "datakey": "n3l2tx5jdkp9s2c8"}@@白蛇[AG³]
56-
getapp3.4.2@@{"host": "http://appcms.4kdq.icu", "key": "R6FVRw4jsy4Hsitj"}@@4K大全[AG³]
57-
getapp3.4.2@@{"host": "https://www.guahd.com/1.txt", "key": "f2A7D4B9E8C16531"}@@瓜萌[AG³]
58-
getapp3.4.2@@{"host": "https://www.gugu3.com", "key": "nKfZ8KX6JTNWRzTD"}@@咕咕动漫[AG³]
59-
getapp3.4.2@@{"host": "https://apiapplbys.lbys.app:5678", "key": "apiapplbyskey168"}@@萝卜[AG³]
60-
getapp3.4.2@@{"host": "https://99.jl8.top/1.txt", "key": "xnybssspqtwotuwj"}@@七月[AG³]
61-
getapp3.4.2@@{"host": "https://qjappcms.sun4k.top", "key": "sBxqXVF5pAHbGzrH"}@@晴天[AG³]
62-
getapp3.4.2@@{"host": "https://sykjw.xyz", "key": "sicnagduxbSfisnz", "api": 2}@@世颜[AG³]
63-
getapp3.4.2@@{"host": "https://guowaiju.com", "key": "7xv16h7qgkrs9b1p"}@@外剧[AG³]
64-
getapp3.4.2@@{"host": "https://appcms.xy4k.com", "key": "7SDWjknU34zqFbVr"}@@小野[AG³]
65-
getapp3.4.2@@{"host": "http://tvb.yy-fun.cc", "key": "jcTz6Jda2aKrH8Tk"}@@掌上追剧[AG³]
52+
getapp3.4.4@@{"host": "https://appcms.xy4k.com", "datakey": "7SDWjknU34zqFbVr"}@@小羊4k[AG³]
53+
getapp3.4.4@@{"host": "https://jingyu4k-1312635929.cos.ap-nanjing.myqcloud.com/1.json", "datakey": "AAdgrdghjfgswerA", "api": 2}@@鲸鱼影视[AG³]
54+
getapp3.4.4@@{"host": "https://staraugust123456.oss-cn-hangzhou.aliyuncs.com/1.txt", "datakey": "staraugust123456", "api": 2}@@云云[AG³]
55+
getapp3.4.4@@{"host": "http://tengxunyunaliyun.oss-cn-shanghai.aliyuncs.com/tengxunyun.txt", "datakey": "n3l2tx5jdkp9s2c8"}@@白蛇[AG³]
56+
getapp3.4.4@@{"host": "http://appcms.4kdq.icu", "key": "R6FVRw4jsy4Hsitj"}@@4K大全[AG³]
57+
getapp3.4.4@@{"host": "https://www.guahd.com/1.txt", "key": "f2A7D4B9E8C16531"}@@瓜萌[AG³]
58+
getapp3.4.4@@{"host": "https://www.gugu3.com", "key": "nKfZ8KX6JTNWRzTD"}@@咕咕动漫[AG³]
59+
getapp3.4.4@@{"host": "https://apiapplbys.lbys.app:5678", "key": "apiapplbyskey168"}@@萝卜[AG³]
60+
getapp3.4.4@@{"host": "https://99.jl8.top/1.txt", "key": "xnybssspqtwotuwj"}@@七月[AG³]
61+
getapp3.4.4@@{"host": "https://qjappcms.sun4k.top", "key": "sBxqXVF5pAHbGzrH"}@@晴天[AG³]
62+
getapp3.4.4@@{"host": "https://sykjw.xyz", "key": "sicnagduxbSfisnz", "api": 2}@@世颜[AG³]
63+
getapp3.4.4@@{"host": "https://guowaiju.com", "key": "7xv16h7qgkrs9b1p"}@@外剧[AG³]
64+
getapp3.4.4@@{"host": "https://appcms.xy4k.com", "key": "7SDWjknU34zqFbVr"}@@小野[AG³]
65+
getapp3.4.4@@{"host": "http://tvb.yy-fun.cc", "key": "jcTz6Jda2aKrH8Tk"}@@掌上追剧[AG³]

docs/pyenv.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@
55
pip install -r spider/py/base/requirements.txt -i https://mirrors.cloud.tencent.com/pypi/simple
66
# linux
77
pip3 install -r spider/py/base/requirements.txt -i https://mirrors.cloud.tencent.com/pypi/simple
8-
```
8+
```
9+
10+
# golang二进制文件
11+
12+
确保根目录下有 `binary/go_proxy` 里面有相应平台的二进制文件即可

index.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ import path from 'path';
33
import os from 'os';
44
import qs from 'qs';
55
import {fileURLToPath} from 'url';
6+
import {spawn} from "child_process";
7+
import {existsSync} from 'fs';
68
import formBody from '@fastify/formbody';
79
import {validateBasicAuth, validateJs, validatePwd} from "./utils/api_validate.js";
10+
import {goProxy, getGoBinary} from "./utils/binaryManager.js"
811
// 注册自定义import钩子
912
import './utils/esm-register.mjs';
1013
// 引入python守护进程
@@ -17,6 +20,7 @@ const {fastify} = fastlogger;
1720
// 获取当前路径
1821
const __dirname = path.dirname(fileURLToPath(import.meta.url));
1922
const PORT = 5757;
23+
const GOPORT = 57571;
2024
const MAX_TEXT_SIZE = 0.1 * 1024 * 1024; // 设置最大文本大小为 0.1 MB
2125
// 定义options的目录
2226
const docsDir = path.join(__dirname, 'docs');
@@ -32,7 +36,8 @@ const catLibDir = path.join(__dirname, 'spider/catLib');
3236
const xbpqDir = path.join(__dirname, 'spider/xbpq');
3337
const viewsDir = path.join(__dirname, 'views');
3438
const configDir = path.join(__dirname, 'config');
35-
39+
const goBinary = getGoBinary(__dirname);
40+
let goProc = null;
3641
// 注册插件以支持 application/x-www-form-urlencoded
3742
fastify.register(formBody);
3843

@@ -135,6 +140,9 @@ process.on('exit', async (code) => {
135140
console.log(`Process exiting with code: ${code}`);
136141
// 这里不能直接用 await fastify.close()(Node 在 exit 里不等异步)
137142
// 但 Fastify 的 SIGINT/SIGTERM 会提前触发,所以这里只记录日志
143+
if (goProc) {
144+
goProc.kill();
145+
}
138146
});
139147

140148
registerRoutes(fastify, {
@@ -163,6 +171,23 @@ registerRoutes(fastify, {
163171
// 启动服务
164172
const start = async () => {
165173
try {
174+
175+
if (existsSync(goBinary)) { // 启动golang二进制
176+
console.log('[goBinary]准备启动go二进制文件:', goBinary);
177+
goProc = spawn(goBinary, ["-p", GOPORT], {
178+
stdio: ["ignore", "pipe", "pipe"],
179+
});
180+
181+
// 打印 Go 服务输出
182+
goProc.stdout.on("data", (data) => {
183+
console.log("[Go-Server]", data.toString().trim());
184+
});
185+
goProc.stderr.on("data", (data) => {
186+
console.log("[Go-Server-STD]", data.toString().trim());
187+
});
188+
} else {
189+
console.log(`[goBinary]找不到go二进制文件:${goBinary},跳过启动`);
190+
}
166191
// 启动 Fastify 服务
167192
// await fastify.listen({port: PORT, host: '0.0.0.0'});
168193
await fastify.listen({port: PORT, host: '::'});

package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {join, basename, dirname, resolve, relative} from 'path';
44
import url from 'url';
55

66
// 要排除的目录列表
7-
const EXCLUDE_DIRS = ['.git', '.idea', 'soft', 'pyTools', 'drop_code', 'jstest', 'local', 'logs', '对话1.txt', 'vod_cache', 'data/mv'];
7+
const EXCLUDE_DIRS = ['.git', '.idea', 'soft', 'binary', 'pyTools', 'drop_code', 'jstest', 'local', 'logs', '对话1.txt', 'vod_cache', 'data/mv'];
88

99
// 要排除的文件列表
1010
const EXCLUDE_FILES = ['config/env.json', '.env', 'spider/js/UC分享.js', 'spider/js/百忙无果[官].js', 'json/UC分享.json', 'jx/奇奇.js', 'jx/芒果关姐.js', 'data/settings/link_data.json', 'index.json', 'custom.json'];

package.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,21 @@
44
import re
55

66
# 要排除的目录列表
7-
EXCLUDE_DIRS = ['.git', '.idea', 'soft', 'pyTools', 'drop_code', 'jstest', 'local', 'logs', '对话1.txt','vod_cache','data/mv']
7+
EXCLUDE_DIRS = ['.git', '.idea', 'soft', 'binary', 'pyTools', 'drop_code', 'jstest', 'local', 'logs', '对话1.txt',
8+
'vod_cache', 'data/mv']
89

910
# 要排除的文件列表
10-
EXCLUDE_FILES = ['config/env.json', '.env','spider/js/UC分享.js','spider/js/百忙无果[官].js','json/UC分享.json','jx/奇奇.js','jx/芒果关姐.js','data/settings/link_data.json','index.json','custom.json']
11+
EXCLUDE_FILES = ['config/env.json', '.env', 'spider/js/UC分享.js', 'spider/js/百忙无果[官].js', 'json/UC分享.json',
12+
'jx/奇奇.js', 'jx/芒果关姐.js', 'data/settings/link_data.json', 'index.json', 'custom.json']
13+
1114

1215
def get_script_dir():
1316
"""
1417
获取当前脚本所在目录
1518
"""
1619
return os.path.dirname(os.path.abspath(__file__))
1720

21+
1822
def filter_green_files(script_dir):
1923
"""
2024
筛选 js 目录下所有带 [密] 的文件
@@ -30,6 +34,7 @@ def filter_green_files(script_dir):
3034

3135
return green_files
3236

37+
3338
def compress_directory(script_dir, green=False):
3439
# 获取当前目录名
3540
current_dir = os.path.basename(script_dir)
@@ -80,6 +85,7 @@ def compress_directory(script_dir, green=False):
8085
except Exception as e:
8186
print(f"压缩失败: {e}")
8287

88+
8389
if __name__ == "__main__":
8490
# 获取脚本所在目录
8591
script_dir = get_script_dir()

scripts/python/App_PY.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@
210210
}
211211
},
212212
{
213-
"key": "py_getapp3.4.2",
213+
"key": "py_getapp3.4.4",
214214
"name": "AG³",
215215
"type": 3,
216-
"api": "clan://sites/lib/getapp3.4.2.py",
216+
"api": "clan://sites/lib/getapp3.4.4.py",
217217
"exts": {
218218
"小羊4k": {
219219
"host": "https://appcms.xy4k.com",

0 commit comments

Comments
 (0)