包含hd_chinese_subtitles
This commit is contained in:
@@ -9,7 +9,7 @@ command-format = """
|
|||||||
# MongoDB 连接
|
# MongoDB 连接
|
||||||
mongo_uri = "mongodb+srv://readonly:cS9NSuiJ1ebHnUL0@cluster0.8mosa.mongodb.net/sehuatang?retryWrites=true&w=majority"
|
mongo_uri = "mongodb+srv://readonly:cS9NSuiJ1ebHnUL0@cluster0.8mosa.mongodb.net/sehuatang?retryWrites=true&w=majority"
|
||||||
db = "sehuatang"
|
db = "sehuatang"
|
||||||
collections = ["asia_codeless_originate", "asia_mosaic_originate","4k_video"]
|
collections = ["hd_chinese_subtitles", "asia_codeless_originate", "asia_mosaic_originate","4k_video"]
|
||||||
|
|
||||||
# 尝试匹配的字段名(存在其一即可)
|
# 尝试匹配的字段名(存在其一即可)
|
||||||
search_fields = ["number"]
|
search_fields = ["number"]
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class FanhaoSearchPlugin(MessagePluginInterface):
|
|||||||
)
|
)
|
||||||
self.mongo_db_name = cfg.get("db", "sehuatang")
|
self.mongo_db_name = cfg.get("db", "sehuatang")
|
||||||
self.collections = cfg.get(
|
self.collections = cfg.get(
|
||||||
"collections", ["asia_codeless_originate", "asia_mosaic_originate","4k_video"]
|
"collections", ["hd_chinese_subtitles", "asia_codeless_originate", "asia_mosaic_originate", "4k_video"]
|
||||||
)
|
)
|
||||||
self.search_fields = cfg.get("search_fields", ["number"]) # 可能的字段名
|
self.search_fields = cfg.get("search_fields", ["number"]) # 可能的字段名
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ class FanhaoSearchPlugin(MessagePluginInterface):
|
|||||||
queries = self._build_queries(code_upper)
|
queries = self._build_queries(code_upper)
|
||||||
self.LOG.debug(f"[{self.name}] 标准化番号={code_upper},查询字段={self.search_fields}")
|
self.LOG.debug(f"[{self.name}] 标准化番号={code_upper},查询字段={self.search_fields}")
|
||||||
for idx, query in enumerate(queries):
|
for idx, query in enumerate(queries):
|
||||||
self.LOG.debug(f"[{self.name}] 执行查询({idx+1}/{len(queries)}): {query}")
|
self.LOG.debug(f"[{self.name}] 执行查询({idx + 1}/{len(queries)}): {query}")
|
||||||
for coll_name in self.collections:
|
for coll_name in self.collections:
|
||||||
try:
|
try:
|
||||||
coll = self.mongo_db.get_collection(coll_name)
|
coll = self.mongo_db.get_collection(coll_name)
|
||||||
@@ -236,7 +236,8 @@ class FanhaoSearchPlugin(MessagePluginInterface):
|
|||||||
# 参数检查
|
# 参数检查
|
||||||
parts = content.split(" ")
|
parts = content.split(" ")
|
||||||
if len(parts) < 2:
|
if len(parts) < 2:
|
||||||
await bot.send_text_message((roomid if roomid else sender), f"❌命令格式错误!\n{self.command_format}", sender)
|
await bot.send_text_message((roomid if roomid else sender), f"❌命令格式错误!\n{self.command_format}",
|
||||||
|
sender)
|
||||||
return False, "命令格式错误"
|
return False, "命令格式错误"
|
||||||
|
|
||||||
if roomid and gbm.get_group_permission(roomid, self.feature) == PermissionStatus.DISABLED:
|
if roomid and gbm.get_group_permission(roomid, self.feature) == PermissionStatus.DISABLED:
|
||||||
@@ -248,7 +249,8 @@ class FanhaoSearchPlugin(MessagePluginInterface):
|
|||||||
f"[{self.name}] 收到查询 command={command} raw='{raw_code}' normalized='{user_code}' db={self.mongo_db_name} collections={self.collections}"
|
f"[{self.name}] 收到查询 command={command} raw='{raw_code}' normalized='{user_code}' db={self.mongo_db_name} collections={self.collections}"
|
||||||
)
|
)
|
||||||
if not user_code:
|
if not user_code:
|
||||||
await bot.send_text_message((roomid if roomid else sender), f"❌命令格式错误!\n{self.command_format}", sender)
|
await bot.send_text_message((roomid if roomid else sender), f"❌命令格式错误!\n{self.command_format}",
|
||||||
|
sender)
|
||||||
return False, "命令格式错误"
|
return False, "命令格式错误"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -269,5 +271,3 @@ class FanhaoSearchPlugin(MessagePluginInterface):
|
|||||||
|
|
||||||
def get_plugin():
|
def get_plugin():
|
||||||
return FanhaoSearchPlugin()
|
return FanhaoSearchPlugin()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user