plugin/gying/README.md
Gying是PanSou的搜索插件,用于从 www.gying.net 网站搜索影视资源。支持多用户登录并配置账户,在搜索时自动聚合所有用户的搜索结果。
cd /Users/macbookpro/Desktop/fish2018/pansou
go run main.go
# 或者编译后运行
go build -o pansou main.go
./pansou
如果需要添加更多账户或管理现有账户,可以访问管理页面:
http://localhost:8888/gying/你的用户名
示例:
http://localhost:8888/gying/myusername
系统会自动:
http://localhost:8888/gying/{hash}📌 提示:请收藏hash后的URL(包含你的专属hash),方便下次访问。
在"登录状态"区域输入:
点击"登录"按钮。
在PanSou主页搜索框输入关键词,系统会自动聚合所有用户的Gying搜索结果!
# 通过API搜索
curl "http://localhost:8888/api/search?kw=遮天"
# 只搜索插件(包括gying)
curl "http://localhost:8888/api/search?kw=遮天&src=plugin"
所有操作通过统一的POST接口:
POST /gying/{hash}
Content-Type: application/json
{
"action": "操作类型",
...其他参数
}
| Action | 说明 | 需要登录 |
|---|---|---|
get_status | 获取状态 | ❌ |
login | 登录 | ❌ |
logout | 退出登录 | ✅ |
test_search | 测试搜索 | ✅ |
请求:
curl -X POST "http://localhost:8888/gying/{hash}" \
-H "Content-Type: application/json" \
-d '{"action": "get_status"}'
成功响应(已登录):
{
"success": true,
"message": "获取成功",
"data": {
"hash": "abc123...",
"logged_in": true,
"status": "active",
"username_masked": "pa****ou",
"login_time": "2025-10-28 12:00:00",
"expire_time": "2026-02-26 12:00:00",
"expires_in_days": 121
}
}
成功响应(未登录):
{
"success": true,
"message": "获取成功",
"data": {
"hash": "abc123...",
"logged_in": false,
"status": "pending"
}
}
请求:
curl -X POST "http://localhost:8888/gying/{hash}" \
-H "Content-Type: application/json" \
-d '{"action": "login", "username": "xxx", "password": "xxx"}'
成功响应:
{
"success": true,
"message": "登录成功",
"data": {
"status": "active",
"username_masked": "pa****ou"
}
}
失败响应:
{
"success": false,
"message": "登录失败: 用户名或密码错误"
}
请求:
curl -X POST "http://localhost:8888/gying/{hash}" \
-H "Content-Type: application/json" \
-d '{"action": "logout"}'
成功响应:
{
"success": true,
"message": "已退出登录",
"data": {
"status": "pending"
}
}
请求:
curl -X POST "http://localhost:8888/gying/{hash}" \
-H "Content-Type: application/json" \
-d '{"action": "test_search", "keyword": "遮天"}'
成功响应:
{
"success": true,
"message": "找到 5 条结果",
"data": {
"keyword": "遮天",
"total_results": 5,
"results": [
{
"title": "遮天:禁区",
"links": [
{
"type": "quark",
"url": "https://pan.quark.cn/s/89f7aeef9681",
"password": ""
}
]
}
]
}
}
# Hash Salt(推荐自定义,增强安全性)
export GYING_HASH_SALT="your-custom-salt-here"
# Cookie加密密钥(32字节,推荐自定义)
export GYING_ENCRYPTION_KEY="your-32-byte-key-here!!!!!!!!!!"
在 gying.go 第20-24行修改:
const (
MaxConcurrentUsers = 10 // 最多使用的用户数(搜索时)
MaxConcurrentDetails = 50 // 最大并发详情请求数
DebugLog = false // 调试日志开关
)
在 gying.go 第27-32行修改默认账户:
var DefaultAccounts = []struct {
Username string
Password string
}{
// 可以添加更多默认账户
// {"user2", "password2"},
}
参数说明:
| 参数 | 默认值 | 说明 | 建议 |
|---|---|---|---|
MaxConcurrentUsers | 10 | 单次搜索最多使用的用户数 | 10-20足够 |
MaxConcurrentDetails | 50 | 最大并发详情请求数 | 50-100 |
DebugLog | false | 是否开启调试日志 | 生产环境false |
cache/gying_users/{hash}.json
{
"hash": "abc123...",
"username": "pansou",
"username_masked": "pa****ou",
"cookie": "BT_auth=xxx; BT_cookietime=xxx",
"status": "active",
"created_at": "2025-10-28T12:00:00+08:00",
"login_at": "2025-10-28T12:00:00+08:00",
"expire_at": "2026-02-26T12:00:00+08:00",
"last_access_at": "2025-10-28T13:00:00+08:00"
}
字段说明:
hash: 用户唯一标识(SHA256,不可逆推用户名)username: 原始用户名(存储)username_masked: 脱敏用户名(如pa****ou)cookie: 登录Cookie(明文存储,建议配置加密)status: 用户状态(pending/active/expired)expire_at: Cookie过期时间(121天)