TDK1969 / nonebot_plugin_bilibilibot

基于Nonebot的bilibili通知插件,可将up主,主播以及番剧的更新/直播动态推送到QQ

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

报错:另一个程序正在使用此文件,进程无法访问

XHLin-gamer opened this issue · comments

感谢您的工作,这个插件非常实用。
但是在进行 取关up主 和 切割主播 操作时,后台报错
image
猜测是检测up主的状态时,读取的json文件未关闭

commented

请问一下,这个bug是能够稳定复现的吗,是每一次进行取关up主或取关主播操作时都会触发?

我这边的几次试验中,是能够稳定复现的

commented

能把你进行测试的配置和环境发一下吗,还有发生bug时前后的日志

commented

以及进行实验的步骤

机器人运行在Window server 2019上,插件添加在ATRI这个机器人下
实验操作如下
image

log如下


PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'C:\\Users\\Administrator\\Desktop\\ATRI-main\\ATRI\\plugins\\bilibilibot/file/stream/17029823.json'
�[36mATRI�[0m | 04-03 12:48:48 | WARNING apscheduler >> Run time of job "清除缓存 (trigger: interval[0:30:00], next run at: 2022-04-03 13:18:29 CST)" was missed by 0:00:19.320399
�[36mATRI�[0m | 04-03 12:49:56 | ERROR nonebot >> Running matcher <Matcher from ATRI.plugins.bilibilibot, type=message, priority=1, temp=False> failed.
Traceback (most recent call last):

  File "C:\Users\Administrator\Desktop\ATRI-main\main.py", line 9, in <module>
    ATRI.run()
    │    └ <function run at 0x0000018982A104C0>
    └ <module 'ATRI' from 'C:\\Users\\Administrator\\Desktop\\ATRI-main\\ATRI\\__init__.py'>

  File "C:\Users\Administrator\Desktop\ATRI-main\ATRI\__init__.py", line 29, in run
    nonebot.run()
    │       └ <function run at 0x00000189827C8160>
    └ <module 'nonebot' from 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\nonebot\\__...

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\__init__.py", line 258, in run
    get_driver().run(*args, **kwargs)
    │                 │       └ {}
    │                 └ ()
    └ <function get_driver at 0x00000189FFDDDAF0>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\drivers\fastapi.py", line 168, in run
    uvicorn.run(
    │       └ <function run at 0x0000018982BB1EE0>
    └ <module 'uvicorn' from 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\uvicorn\\__...

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\uvicorn\main.py", line 463, in run
    server.run()
    │      └ <function Server.run at 0x0000018982BBF0D0>
    └ <uvicorn.server.Server object at 0x000001898AD821C0>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\uvicorn\server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
           │       │   │    │             └ None
           │       │   │    └ <function Server.serve at 0x0000018982BBF160>
           │       │   └ <uvicorn.server.Server object at 0x000001898AD821C0>
           │       └ <function run at 0x0000018981CD51F0>
           └ <module 'asyncio' from 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python39\\lib\\asyncio\\__init__.py'>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
           │    │                  └ <coroutine object Server.serve at 0x000001898AD64A40>
           │    └ <function BaseEventLoop.run_until_complete at 0x00000189821D3670>
           └ <ProactorEventLoop running=True closed=False debug=False>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 629, in run_until_complete
    self.run_forever()
    │    └ <function ProactorEventLoop.run_forever at 0x000001898223B820>
    └ <ProactorEventLoop running=True closed=False debug=False>

  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 596, in run_forever
    self._run_once()
    │    └ <function BaseEventLoop._run_once at 0x00000189821D6160>
    └ <ProactorEventLoop running=True closed=False debug=False>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1890, in _run_once
    handle._run()
    │      └ <function Handle._run at 0x000001898216C1F0>
    └ <Handle <TaskWakeupMethWrapper object at 0x000001898B081160>(<Task finishe... 17029823'})]>)>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
    │    │            │    │           │    └ <member '_args' of 'Handle' objects>
    │    │            │    │           └ <Handle <TaskWakeupMethWrapper object at 0x000001898B081160>(<Task finishe... 17029823'})]>)>
    │    │            │    └ <member '_callback' of 'Handle' objects>
    │    │            └ <Handle <TaskWakeupMethWrapper object at 0x000001898B081160>(<Task finishe... 17029823'})]>)>
    │    └ <member '_context' of 'Handle' objects>
    └ <Handle <TaskWakeupMethWrapper object at 0x000001898B081160>(<Task finishe... 17029823'})]>)>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\message.py", line 153, in _check_matcher
    await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
          │            │        │    │      │      │      └ {<function _command at 0x00000189827E3670>: <Task finished name='Task-766555' coro=<_command() done, defined at C:\Users\Admi...
          │            │        │    │      │      └ <contextlib.AsyncExitStack object at 0x000001898B2935E0>
          │            │        │    │      └ {'_prefix': {'command': ('取关up',), 'raw_command': '/取关up', 'command_arg': [MessageSegment(type='text', data={'text': '主 17029...
          │            │        │    └ PrivateMessageEvent(time=1648961396, self_id=bots's qq, post_type='message', sub_type='friend', user_id=1234567890, message_...
          │            │        └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x000001898AE46AC0>
          │            └ <Matcher from ATRI.plugins.bilibilibot, type=message, priority=1, temp=False>
          └ <function _run_matcher at 0x0000018982989310>

> File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\message.py", line 202, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
          │       │   │    │      │      │      └ {<function _command at 0x00000189827E3670>: <Task finished name='Task-766555' coro=<_command() done, defined at C:\Users\Admi...
          │       │   │    │      │      └ <contextlib.AsyncExitStack object at 0x000001898B2935E0>
          │       │   │    │      └ {'_prefix': {'command': ('取关up',), 'raw_command': '/取关up', 'command_arg': [MessageSegment(type='text', data={'text': '主 17029...
          │       │   │    └ PrivateMessageEvent(time=1648961396, self_id=bots's qq, post_type='message', sub_type='friend', user_id=1234567890, message_...
          │       │   └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x000001898AE46AC0>
          │       └ <function Matcher.run at 0x00000189827E31F0>
          └ <Matcher from ATRI.plugins.bilibilibot, type=message, priority=1, temp=False>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\internal\matcher.py", line 668, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
          │    │          │    │      │      │      └ {<function _command at 0x00000189827E3670>: <Task finished name='Task-766555' coro=<_command() done, defined at C:\Users\Admi...
          │    │          │    │      │      └ <contextlib.AsyncExitStack object at 0x000001898B2935E0>
          │    │          │    │      └ {'_prefix': {'command': ('取关up',), 'raw_command': '/取关up', 'command_arg': [MessageSegment(type='text', data={'text': '主 17029...
          │    │          │    └ PrivateMessageEvent(time=1648961396, self_id=bots's qq, post_type='message', sub_type='friend', user_id=1234567890, message_...
          │    │          └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x000001898AE46AC0>
          │    └ <function Matcher.simple_run at 0x00000189827E3160>
          └ <Matcher from ATRI.plugins.bilibilibot, type=message, priority=1, temp=False>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\internal\matcher.py", line 635, in simple_run
    await handler(
          └ <Dependent call=<function unfollowUpCommandHandler at 0x000001898400DDC0>, params=[ModelField(name='event', type=Union[Privat...

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\dependencies\__init__.py", line 92, in __call__
    return await self.call(**values)
                 │    │      └ {'event': PrivateMessageEvent(time=1648961396, self_id=bots's qq, post_type='message', sub_type='friend', user_id=1234567890...
                 │    └ <function unfollowUpCommandHandler at 0x000001898400DDC0>
                 └ <Dependent call=<function unfollowUpCommandHandler at 0x000001898400DDC0>, params=[ModelField(name='event', type=Union[Privat...

  File "C:\Users\Administrator\Desktop\ATRI-main\ATRI\plugins\bilibilibot\__init__.py", line 131, in unfollowUpCommandHandler
    successList, failList = await UnfollowUp(event, event.sender.user_id, uidList, 0)
                                  │          │      │     │      │        └ ['主', '17029823']
                                  │          │      │     │      └ 1234567890
                                  │          │      │     └ Sender(user_id=1234567890, nickname='笑幻', sex='unknown', age=0, card=None, area=None, level=None, role=None, title=None)
                                  │          │      └ PrivateMessageEvent(time=1648961396, self_id=bots's qq, post_type='message', sub_type='friend', user_id=1234567890, message_...
                                  │          └ PrivateMessageEvent(time=1648961396, self_id=bots's qq, post_type='message', sub_type='friend', user_id=1234567890, message_...
                                  └ <function UnfollowUp at 0x0000018983FDBE50>

  File "C:\Users\Administrator\Desktop\ATRI-main\ATRI\plugins\bilibilibot\biliVideo.py", line 291, in UnfollowUp
    isSuccess, s = await UnfollowModifyUpFile(uid, id, type)
    │                    │                    │    │   └ 0
    │                    │                    │    └ 1234567890
    │                    │                    └ '17029823'
    │                    └ <function UnfollowModifyUpFile at 0x0000018983FDBD30>
    └ False

  File "C:\Users\Administrator\Desktop\ATRI-main\ATRI\plugins\bilibilibot\biliVideo.py", line 216, in UnfollowModifyUpFile
    os.remove(upFile)
    │  │      └ 'C:\\Users\\Administrator\\Desktop\\ATRI-main\\ATRI\\plugins\\bilibilibot/file/up/17029823.json'
    │  └ <built-in function remove>
    └ <module 'os' from 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python39\\lib\\os.py'>
commented

我的环境是Ubuntu,我没能复现这个错误
看来是在删除文件时出了问题
能再做一个测试吗?用另一个qq或者群,使用命令/关注up 17029823,看是不是被占用的问题
P.S 命令是取关up,不是取关up主

谢谢您的回复,在另一个群中关注up和关注主播的功能都是正常的。新的群或者用户可以被写入json文件。这个问题似乎只会出现在取关的环节上。

commented

在多个群或用户关注up时,使用其中一个qq进行取关指令,会怎么样?

在一个up主被多个QQ账号同时关注的情况下,群聊能够正常的取关,私聊会出现如上的报错

commented

可以做一下如下测试,并将发一下错误的相关日志吗?

  • 在一个up主被多个qq账号同时关注时,其中一个qq对进行取关up主的操作

这样应该是不会进入删除文件的代码的,想看看错误还会出现在哪里

在目标up主此时有1个用户,两个群聊的关注。此时如果由唯一的用户进行取关,似乎会忽略仍然存在的群聊,进入文件删除的步骤

�[36mATRI�[0m | 04-03 15:34:35 | DEBUG ATRI.plugins.bilibilibot.biliVideo >> B站整合~视频正在读取用户eroengine文件
�[36mATRI�[0m | 04-03 15:34:35 | DEBUG ATRI.plugins.bilibilibot.biliVideo >> B站整合~视频up主eroengine已无人关注,将文件删除
�[36mATRI�[0m | 04-03 15:34:35 | INFO nonebot >> Matcher <Matcher from ATRI.plugins.bilibilibot, type=message, priority=1, temp=False> running complete
�[36mATRI�[0m | 04-03 15:34:35 | ERROR nonebot >> Running matcher <Matcher from ATRI.plugins.bilibilibot, type=message, priority=1, temp=False> failed.
Traceback (most recent call last):

  File "C:\Users\Administrator\Desktop\ATRI-main\main.py", line 9, in <module>
    ATRI.run()
    │    └ <function run at 0x0000015FFF7204C0>
    └ <module 'ATRI' from 'C:\\Users\\Administrator\\Desktop\\ATRI-main\\ATRI\\__init__.py'>

  File "C:\Users\Administrator\Desktop\ATRI-main\ATRI\__init__.py", line 29, in run
    nonebot.run()
    │       └ <function run at 0x0000015FFF4D8160>
    └ <module 'nonebot' from 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\nonebot\\__...

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\__init__.py", line 258, in run
    get_driver().run(*args, **kwargs)
    │                 │       └ {}
    │                 └ ()
    └ <function get_driver at 0x0000015FFCADDAF0>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\drivers\fastapi.py", line 168, in run
    uvicorn.run(
    │       └ <function run at 0x0000015FFF8C1EE0>
    └ <module 'uvicorn' from 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\uvicorn\\__...

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\uvicorn\main.py", line 463, in run
    server.run()
    │      └ <function Server.run at 0x0000015FFF8CF0D0>
    └ <uvicorn.server.Server object at 0x0000015F87A3C790>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\uvicorn\server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
           │       │   │    │             └ None
           │       │   │    └ <function Server.serve at 0x0000015FFF8CF160>
           │       │   └ <uvicorn.server.Server object at 0x0000015F87A3C790>
           │       └ <function run at 0x0000015FFEDE51F0>
           └ <module 'asyncio' from 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python39\\lib\\asyncio\\__init__.py'>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
           │    │                  └ <coroutine object Server.serve at 0x0000015F87A3A5C0>
           │    └ <function BaseEventLoop.run_until_complete at 0x0000015FFEEE3670>
           └ <ProactorEventLoop running=True closed=False debug=False>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 629, in run_until_complete
    self.run_forever()
    │    └ <function ProactorEventLoop.run_forever at 0x0000015FFEF4B820>
    └ <ProactorEventLoop running=True closed=False debug=False>

  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 596, in run_forever
    self._run_once()
    │    └ <function BaseEventLoop._run_once at 0x0000015FFEEE6160>
    └ <ProactorEventLoop running=True closed=False debug=False>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1890, in _run_once
    handle._run()
    │      └ <function Handle._run at 0x0000015FFEE7C1F0>
    └ <Handle <TaskWakeupMethWrapper object at 0x0000015F8801FC40>(<Task finishe...'17029823'})]>)>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
    │    │            │    │           │    └ <member '_args' of 'Handle' objects>
    │    │            │    │           └ <Handle <TaskWakeupMethWrapper object at 0x0000015F8801FC40>(<Task finishe...'17029823'})]>)>
    │    │            │    └ <member '_callback' of 'Handle' objects>
    │    │            └ <Handle <TaskWakeupMethWrapper object at 0x0000015F8801FC40>(<Task finishe...'17029823'})]>)>
    │    └ <member '_context' of 'Handle' objects>
    └ <Handle <TaskWakeupMethWrapper object at 0x0000015F8801FC40>(<Task finishe...'17029823'})]>)>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\message.py", line 153, in _check_matcher
    await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
          │            │        │    │      │      │      └ {<function _command at 0x0000015FFF4F4670>: <Task finished name='Task-117686' coro=<_command() done, defined at C:\Users\Admi...
          │            │        │    │      │      └ <contextlib.AsyncExitStack object at 0x0000015F87E495B0>
          │            │        │    │      └ {'_prefix': {'command': ('取关up',), 'raw_command': '/取关up', 'command_arg': [MessageSegment(type='text', data={'text': '1702982...
          │            │        │    └ PrivateMessageEvent(time=1648971275, self_id=bot's qq, post_type='message', sub_type='friend', user_id=my qq, message_...
          │            │        └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x0000015F87B41520>
          │            └ <Matcher from ATRI.plugins.bilibilibot, type=message, priority=1, temp=False>
          └ <function _run_matcher at 0x0000015FFF699310>

> File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\message.py", line 202, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
          │       │   │    │      │      │      └ {<function _command at 0x0000015FFF4F4670>: <Task finished name='Task-117686' coro=<_command() done, defined at C:\Users\Admi...
          │       │   │    │      │      └ <contextlib.AsyncExitStack object at 0x0000015F87E495B0>
          │       │   │    │      └ {'_prefix': {'command': ('取关up',), 'raw_command': '/取关up', 'command_arg': [MessageSegment(type='text', data={'text': '1702982...
          │       │   │    └ PrivateMessageEvent(time=1648971275, self_id=bot's qq, post_type='message', sub_type='friend', user_id=my qq, message_...
          │       │   └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x0000015F87B41520>
          │       └ <function Matcher.run at 0x0000015FFF4F41F0>
          └ <Matcher from ATRI.plugins.bilibilibot, type=message, priority=1, temp=False>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\internal\matcher.py", line 668, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
          │    │          │    │      │      │      └ {<function _command at 0x0000015FFF4F4670>: <Task finished name='Task-117686' coro=<_command() done, defined at C:\Users\Admi...
          │    │          │    │      │      └ <contextlib.AsyncExitStack object at 0x0000015F87E495B0>
          │    │          │    │      └ {'_prefix': {'command': ('取关up',), 'raw_command': '/取关up', 'command_arg': [MessageSegment(type='text', data={'text': '1702982...
          │    │          │    └ PrivateMessageEvent(time=1648971275, self_id=bot's qq, post_type='message', sub_type='friend', user_id=my qq, message_...
          │    │          └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x0000015F87B41520>
          │    └ <function Matcher.simple_run at 0x0000015FFF4F4160>
          └ <Matcher from ATRI.plugins.bilibilibot, type=message, priority=1, temp=False>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\internal\matcher.py", line 635, in simple_run
    await handler(
          └ <Dependent call=<function unfollowUpCommandHandler at 0x0000015F879FB9D0>, params=[ModelField(name='event', type=Union[Privat...

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\dependencies\__init__.py", line 92, in __call__
    return await self.call(**values)
                 │    │      └ {'event': PrivateMessageEvent(time=1648971275, self_id=bot's qq, post_type='message', sub_type='friend', user_id=my qq...
                 │    └ <function unfollowUpCommandHandler at 0x0000015F879FB9D0>
                 └ <Dependent call=<function unfollowUpCommandHandler at 0x0000015F879FB9D0>, params=[ModelField(name='event', type=Union[Privat...

  File "C:\Users\Administrator\Desktop\ATRI-main\ATRI\plugins\bilibilibot\__init__.py", line 131, in unfollowUpCommandHandler
    successList, failList = await UnfollowUp(event, event.sender.user_id, uidList, 0)
                                  │          │      │     │      │        └ ['17029823']
                                  │          │      │     │      └ my qq
                                  │          │      │     └ Sender(user_id=my qq, nickname='笑幻', sex='unknown', age=0, card=None, area=None, level=None, role=None, title=None)
                                  │          │      └ PrivateMessageEvent(time=1648971275, self_id=bot's qq, post_type='message', sub_type='friend', user_id=my qq, message_...
                                  │          └ PrivateMessageEvent(time=1648971275, self_id=bot's qq, post_type='message', sub_type='friend', user_id=my qq, message_...
                                  └ <function UnfollowUp at 0x0000015F879E8E50>

  File "C:\Users\Administrator\Desktop\ATRI-main\ATRI\plugins\bilibilibot\biliVideo.py", line 291, in UnfollowUp
    isSuccess, s = await UnfollowModifyUpFile(uid, id, type)
                         │                    │    │   └ 0
                         │                    │    └ my qq
                         │                    └ '17029823'
                         └ <function UnfollowModifyUpFile at 0x0000015F879E8D30>

  File "C:\Users\Administrator\Desktop\ATRI-main\ATRI\plugins\bilibilibot\biliVideo.py", line 216, in UnfollowModifyUpFile
    os.remove(upFile)
    │  │      └ 'C:\\Users\\Administrator\\Desktop\\ATRI-main\\ATRI\\plugins\\bilibilibot/file/up/17029823.json'
    │  └ <built-in function remove>
    └ <module 'os' from 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python39\\lib\\os.py'>

PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'C:\\Users\\Administrator\\Desktop\\ATRI-main\\ATRI\\plugins\\bilibilibot/file/up/17029823.json'
commented

感谢你的配合,我发现问题了
在三个取关函数里面,对是否还有人关注的判断发生了错误,所以会在还有人关注的情况下删除文件,这可能导致了你反映的错误
请做出如下修改,看是否还会发生你是反映的错误,感谢

  • 在biliStream.py的UnfollowModifyStreamerFile函数中, 将if streamerInfo[3] and streamerInfo[4]:修改 if streamerInfo[3] or streamerInfo[4]:
  • 在biliVideo.py的UnfollowModifyUpFile函数中,将if upInfo[2] and upInfo[3]:修改为if upInfo[2] or upInfo[3]:
  • 在biliTelegram.py的UnfollowModifyTelegramFile函数中,将if telegramInfo[2] or telegramInfo[3]:修改为if telegramInfo[2] or telegramInfo[3]:

感谢您的回复,如上修改后,在仍然有其他用户关注的情况下,进入删除文件的程序的问题已得到消除。

commented

好的 已经将修复的代码上传到github,并上传到pypi
更新到版本2.0.1