fix 获取emby日志 最新200行

This commit is contained in:
thsrite
2024-08-26 14:25:04 +08:00
parent 991cd37a12
commit cd6462071d

View File

@@ -610,7 +610,7 @@ class EmbyDanmu(_PluginBase):
def __get_emby_log(self) -> str:
"""
获取emby日志
获取emby日志 最新200行
"""
if not self._EMBY_HOST or not self._EMBY_APIKEY:
return ""
@@ -618,7 +618,9 @@ class EmbyDanmu(_PluginBase):
self._EMBY_HOST, self._EMBY_APIKEY)
with RequestUtils().get_res(req_url) as res:
if res:
return res.text
emby_log = res.text.split("\n")
emby_log = emby_log[-200:]
return "\n".join(emby_log)
else:
logger.info(f"获取插件详情失败无法连接Emby")
return ""
@@ -639,6 +641,12 @@ class EmbyDanmu(_PluginBase):
if not matches:
all_matched = False
break
pattern = fr'\[{source}\]弹幕内容少于1KB忽略处理.{item_name}'
matches = re.findall(pattern, emby_log)
if not matches:
all_matched = False
break
return all_matched
@staticmethod