LambdaYH / zhenxun_plugin_weibo

移植自KokkoroBot-Multi-Platform,适配zhenxun_bot的微博推送插件
GNU General Public License v3.0
4 stars 0 forks source link

一些意见 #4

Closed Nenot233 closed 1 year ago

Nenot233 commented 1 year ago

关于微博检测问题,可以检测上一条为准

因为像调试BOT需要重启的时候就检测不到就不推送了←目前遇到的问题

或者有更好的检测方式

LambdaYH commented 1 year ago

理论上来说重启BOT不会导致该推送的微博不被推送,如果发生这种情况,有以下几种可能

  1. 第一次启动。第一次启动时会忽略先前的所有微博防止刷屏。
  2. 非第一次启动但人为删除了'TEMP_PATH / "weibo"'文件夹。
  3. 在重启BOT之前已经获取到了新的微博,但是获取到微博至发送消息之间的时间段你重启了Bot
  4. 重启之前微博发送时间在过去的2小时内,此时还未获取微博,但重启后微博发送时间在过去2h之前了,因为会忽略一切2h前发送的微博,所以这样也不会推送新的。
  5. 'm.weibo.cn'与'weibo.com'两个站点微博有时会出现不同步问题,甚至极少情况会获取不到部分微博(加cookie可以有效缓解)。

不知道你遇到的情况是否在上述之中?

关于检测上一条的话,因为即使以检测上一条作为判断更新的依据,也是在同样的时间节点存储记录,还会有置顶等的干扰。而且目前是将获取到的最近n条记录(api一次性获取微博数的上限)的,也包括上一条的信息。

Nenot233 commented 1 year ago
  1. 第4点,我是把时间调整1分钟检测一次 @scheduler.scheduled_job("interval", seconds=60, jitter=10)
  2. 微博是11:58分发送 image 3.cookie确认有效 4.该微博推送2个群都没有收到信息,且确认开启了微博推送
Nenot233 commented 1 year ago

微博链接 https://weibo.com/1907840615/MgDMgibFu

LambdaYH commented 1 year ago

如果正确获取到了微博会有成功获取@xxx的新微博,没获取到会有未检测到@xxxx的新微博的日志,希望可以定位到那儿发送日志看看。

Nenot233 commented 1 year ago

请问一下真寻在哪找这个日志? "data/log"? 2022-11-25.log这个文件并未能找到未检测到@xxxx的新微博的日志

LambdaYH commented 1 year ago

image

如果没有可以看看启动时候插件有没有被正确加载

Nenot233 commented 1 year ago

在真寻帮助里面,能看得见微博推送这个插件,但是log上面确实没有 2022-11-25.log

LambdaYH commented 1 year ago

emmmm,你这个日志怎么没有正常启动后的状态,我搜weibo都没搜到相关的东西,如果正常的话是会有Succeeded to import zhenxun_plugin_weiboimage

Nenot233 commented 1 year ago

我在等等看,会不会出现这个情况,有的话在反馈吧,目前是已经重启了 image image

Nenot233 commented 1 year ago

11-29 08:01:07 [ERROR] zhenxun_plugin_weibo | 'NoneType' object is not subscriptable Traceback (most recent call last): File "D:\BOT\zhenxun_bot\bot.py", line 22, in nonebot.run() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\nonebot__init__.py", line 273, in run get_driver().run(*args, kwargs) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\nonebot\drivers\fastapi.py", line 172, in run uvicorn.run( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\uvicorn\main.py", line 576, in run server.run() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\uvicorn\server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 634, in run_until_complete self.run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 601, in run_forever self._run_once() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1905, in _run_once handle._run() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, self._args) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\apscheduler\executors\base_py3.py", line 30, in run_coroutine_job retval = await job.func(job.args, job.kwargs) File "D:\BOT\zhenxun_bot\extensive_plugin\zhenxun_pluginweibo__init__.py", line 233, in latest_weibos = await spider.get_latest_weibos() File "D:\BOT\zhenxun_bot\extensive_plugin\zhenxun_plugin_weibo\weibo_spider.py", line 386, in get_latest_weibos wb = await self.get_one_weibo(w)

File "D:\BOT\zhenxun_bot\extensive_plugin\zhenxun_plugin_weibo\weibo_spider.py", line 360, in get_one_weibo retweet = self.parse_weibo(retweeted_status) File "D:\BOT\zhenxun_bot\extensive_plugin\zhenxun_plugin_weibo\weibo_spider.py", line 295, in parse_weibo weibo["screen_name"] = weibo_info["user"]["screen_name"] TypeError: 'NoneType' object is not subscriptable 询问一下,这个报错是因为我设置有问题吗?仅修改了weibo_config.yaml和init.py

LambdaYH commented 1 year ago

微博用户id丢过来看看

Nenot233 commented 1 year ago

Nenot104

LambdaYH commented 1 year ago

image 测试了一下没发现什么问题,估计你config里user_id填错了

Nenot233 commented 1 year ago

但是能正常推送

Nenot233 commented 1 year ago

image 但是一检测就一片报错

Nenot233 commented 1 year ago

weibo-133: desciption: 测试微博推送 enable_on_default: False format: 0 users:

LambdaYH commented 1 year ago

emmm image image 我没办法复现

Nenot233 commented 1 year ago

这份iss里面有个log有敏感信息,能删掉么)