HibiKier / zhenxun_bot

基于 Nonebot2 开发,非常可爱的绪山真寻bot
GNU Affero General Public License v3.0
3.37k stars 607 forks source link

无法访问8080端口 #4

Closed Terli closed 3 years ago

Terli commented 3 years ago

萌新初入门还请见谅,按照流程部署后,

填入API项:LOLICON_KEY与ALAPI_TOKEN

填入数据库bind项(数据库只是建了一个库没有过多的配置,也通过shell确认过能连入)

python bot.py后,显示到

07-06 15:39:44 [INFO] uvicorn | Application startup complete. 07-06 15:39:44 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit) 07-06 15:41:33 [INFO] uvicorn | 127.0.0.1:62371 - "GET / HTTP/1.1" 404 07-06 15:41:33 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico HTTP/1.1" 307 07-06 15:41:33 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico/ HTTP/1.1" 405 07-06 15:41:34 [INFO] uvicorn | 127.0.0.1:62371 - "GET / HTTP/1.1" 404 07-06 15:41:34 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico HTTP/1.1" 307 07-06 15:41:34 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico/ HTTP/1.1" 405 07-06 15:41:34 [INFO] uvicorn | 127.0.0.1:62371 - "GET / HTTP/1.1" 404

通关chrome访问127.0.0.1:8080页面只有{"detail":"Not Found"} 请问是哪里发生的问题?

整段命令行输出

C:\Users\adm\Desktop\zhenxun\zhenxun_bot>python bot.py 07-06 15:38:59 [INFO] nonebot | NoneBot is initializing... 07-06 15:38:59 [INFO] nonebot | Current Env: dev 07-06 15:38:59 [DEBUG] nonebot | Loaded Config: {'driver': 'nonebot.drivers.fastapi', 'host': IPv4Address('127.0.0.1'), 'port': 8080, 'debug': True, 'api_root': {}, 'api_timeout': 30.0, 'access_token': None, 'secret': None, 'superusers': {''}, 'nickname': {'真寻', '绪山真寻', '小真寻', '小寻子'}, 'command_start': {''}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(seconds=30), 'session_running_expression': '别急呀,小真寻要宕机了!QAQ', 'environment': 'dev'} 07-06 15:39:01 [DEBUG] nonebot | Succeeded to load adapter "cqhttp" 07-06 15:39:01 [INFO] nonebot | Succeeded to import "nonebot.plugins.echo" 07-06 15:39:14 [INFO] nonebot | Succeeded to import "nonebot_plugin_apscheduler" 07-06 15:39:27 [INFO] nonebot | Succeeded to import "one_friend" 07-06 15:39:27 [INFO] nonebot | Succeeded to import "my_info" 07-06 15:39:27 [INFO] nonebot | Succeeded to import "nickname" 07-06 15:39:27 [INFO] nonebot | Succeeded to import "update_info" 07-06 15:39:27 [INFO] nonebot | Succeeded to import "russian" 07-06 15:39:27 [INFO] nonebot | Succeeded to import "songpicker2" 07-06 15:39:27 [INFO] nonebot | Succeeded to import "nonebot_plugin_manager" 07-06 15:39:28 [INFO] nonebot | Succeeded to import "admin_bot_manage" 07-06 15:39:28 [INFO] nonebot | Succeeded to import "sign_in" 07-06 15:39:28 [INFO] nonebot | Succeeded to import "ban" 07-06 15:39:28 [INFO] nonebot | Succeeded to import "search_buff_skin_price" 07-06 15:39:28 [INFO] nonebot | Succeeded to import "admin_config" 07-06 15:39:28 [INFO] nonebot | Succeeded to import "open_cases" 07-06 15:39:30 [INFO] nonebot | Succeeded to import "coser" 07-06 15:39:30 [INFO] nonebot | Succeeded to import "pid_search" 07-06 15:39:31 [INFO] nonebot | Succeeded to import "update_pic" 07-06 15:39:32 [INFO] nonebot | Succeeded to import "weather" 07-06 15:39:32 [INFO] nonebot | Succeeded to import "mute" 07-06 15:39:32 [INFO] nonebot | Succeeded to import "fudu" 07-06 15:39:32 [INFO] nonebot | Succeeded to import "auto_invite" 07-06 15:39:33 [INFO] nonebot | Succeeded to import "draw_card" 07-06 15:39:33 [INFO] nonebot | Succeeded to import "send_dinggong_voice" 07-06 15:39:33 [INFO] nonebot | Succeeded to import "yiqing" 07-06 15:39:34 [INFO] nonebot | Succeeded to import "parse_bilibili_json" 07-06 15:39:34 [INFO] nonebot | Succeeded to import "translate" 07-06 15:39:35 [INFO] nonebot | Succeeded to import "help" 07-06 15:39:35 [INFO] nonebot | Succeeded to import "check" 07-06 15:39:35 [INFO] nonebot | Succeeded to import "admin_help" 07-06 15:39:35 [INFO] nonebot | Succeeded to import "broadcast" 07-06 15:39:35 [INFO] nonebot | Succeeded to import "move_img" 07-06 15:39:35 [INFO] nonebot | Succeeded to import "group_welcome_msg" 07-06 15:39:35 [INFO] nonebot | Succeeded to import "ai" 07-06 15:39:35 [INFO] nonebot | Succeeded to import "statistics_handle" 07-06 15:39:35 [INFO] nonebot | Succeeded to import "bt" 07-06 15:39:36 [INFO] nonebot | Succeeded to import "pixiv" 07-06 15:39:36 [INFO] nonebot | Succeeded to import "update_gocqhttp" 07-06 15:39:36 [INFO] nonebot | Succeeded to import "search_anime" 07-06 15:39:36 [INFO] nonebot | Succeeded to import "quotations" 07-06 15:39:36 [INFO] nonebot | Succeeded to import "update_setu" 07-06 15:39:36 [INFO] nonebot | Succeeded to import "send_img" 07-06 15:39:36 [ERROR] nonebot | Failed to import "test" Traceback (most recent call last): File "C:\Users\adm\Desktop\zhenxun\zhenxun_bot\bot.py", line 12, in nonebot.load_plugins("plugins") File "C:\Users\adm\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\plugin__init__.py", line 981, in load_plugins result = context.run(_load_plugin, manager, plugin_name)

File "C:\Users\adm\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\plugin__init.py", line 929, in _load_plugin module = manager.load_plugin(plugin_name) File "C:\Users\adm\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\plugin\manager.py", line 154, in load_plugin return importlib.import_module(f"{self.namespace}.{name}") File "C:\Users\adm\AppData\Local\Programs\Python\Python39\lib\importlib__init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "C:\Users\adm\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\plugin\manager.py", line 221, in exec_module super().exec_module(module) File "", line 850, in exec_module File "", line 228, in _call_with_frames_removed File "C:\Users\adm\Desktop\zhenxun\zhenxun_bot\plugins\test.py", line 25, in from utils.browser import get_browser File "C:\Users\adm\Desktop\zhenxun\zhenxun_bot\utils\browser.py", line 4, in from playwright.async_api import Browser, async_playwright ModuleNotFoundError: No module named 'playwright' 07-06 15:39:37 [INFO] nonebot | Succeeded to import "shop" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "dialogue" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "jitang" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "luxun" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "group_handle" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "alapi" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "group_level" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "poke" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "super_cmd" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "send_setu" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "nonebot_plugin_withdraw" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "statistics_hook" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "aconfig" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "hook" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "nonebot_plugin_picsearcher" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "white2black_img" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "super_help" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "reimu" 07-06 15:39:37 [INFO] nonebot | Succeeded to import "remind" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "what_anime" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "delete_img" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "upload_img" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "epic" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "fake_msg" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "last_chat" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "buy" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "use" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "my_props" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "shop_handle" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "reset_today_gold" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "gold" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "gold_redbag" 07-06 15:39:38 [ERROR] nonebot | Failed to import "material_remind" Traceback (most recent call last): File "C:\Users\adm\Desktop\zhenxun\zhenxun_bot\bot.py", line 14, in nonebot.load_plugins("plugins/genshin") File "C:\Users\adm\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\plugin\init.py", line 981, in load_plugins result = context.run(_load_plugin, manager, plugin_name) File "C:\Users\adm\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\plugin\init.py", line 929, in _load_plugin module = manager.load_plugin(plugin_name) File "C:\Users\adm\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\plugin\manager.py", line 154, in load_plugin return importlib.import_module(f"{self.namespace}.{name}") File "C:\Users\adm\AppData\Local\Programs\Python\Python39\lib\importlib\init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "C:\Users\adm\AppData\Local\Programs\Python\Python39\lib\site-packages\nonebot\plugin\manager.py", line 221, in exec_module super().exec_module(module) File "", line 850, in exec_module File "", line 228, in _call_with_frames_removed File "C:\Users\adm\Desktop\zhenxun\zhenxun_bot\plugins/genshin\material_remind\init__.py", line 5, in from utils.browser import get_browser File "C:\Users\adm\Desktop\zhenxun\zhenxun_bot\utils\browser.py", line 4, in from playwright.async_api import Browser, async_playwright ModuleNotFoundError: No module named 'playwright' 07-06 15:39:38 [INFO] nonebot | Succeeded to import "qiu_qiu_translation" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "query_resource_points" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "almanac" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "util" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "cover" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "poetry" 07-06 15:39:38 [INFO] nonebot | Succeeded to import "comments_163" 07-06 15:39:38 [INFO] nonebot | Running NoneBot... 07-06 15:39:38 [DEBUG] nonebot | Loaded adapters: cqhttp 07-06 15:39:39 [INFO] uvicorn | Started server process [5656] 07-06 15:39:39 [INFO] uvicorn | Waiting for application startup. [2021-07-06 15:39:41,604] - db_context.py[line:21] - INFO: Database loaded successfully! 07-06 15:39:41 [INFO] nonebot_plugin_apscheduler | Scheduler Started [2021-07-06 15:39:42,213] - util.py[line:245] - INFO: 成功获取赛马娘当前up信息...当前up池: 6月29日新角色追加 & 6月29日新角色追加 [2021-07-06 15:39:43,027] - prts_handle.py[line:154] - INFO: 成功获取明日方舟当前up信息...当前up池: 【从星火中来】 [2021-07-06 15:39:43,291] - util.py[line:245] - INFO: 成功获取原神当前up信息...当前up池: 「叶落风随」 & 「神铸赋形」 07-06 15:39:44 [INFO] uvicorn | Application startup complete. 07-06 15:39:44 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit) 07-06 15:41:33 [INFO] uvicorn | 127.0.0.1:62371 - "GET / HTTP/1.1" 404 07-06 15:41:33 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico HTTP/1.1" 307 07-06 15:41:33 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico/ HTTP/1.1" 405 07-06 15:41:34 [INFO] uvicorn | 127.0.0.1:62371 - "GET / HTTP/1.1" 404 07-06 15:41:34 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico HTTP/1.1" 307 07-06 15:41:34 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico/ HTTP/1.1" 405 07-06 15:41:34 [INFO] uvicorn | 127.0.0.1:62371 - "GET / HTTP/1.1" 404 07-06 15:41:34 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico HTTP/1.1" 307 07-06 15:41:34 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico/ HTTP/1.1" 405 07-06 15:41:34 [INFO] uvicorn | 127.0.0.1:62371 - "GET / HTTP/1.1" 404 07-06 15:41:34 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico HTTP/1.1" 307 07-06 15:41:34 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico/ HTTP/1.1" 405 07-06 15:41:34 [INFO] uvicorn | 127.0.0.1:62371 - "GET / HTTP/1.1" 404 07-06 15:41:34 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico HTTP/1.1" 307 07-06 15:41:34 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico/ HTTP/1.1" 405 07-06 15:41:35 [INFO] uvicorn | 127.0.0.1:62371 - "GET / HTTP/1.1" 404 07-06 15:41:35 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico HTTP/1.1" 307 07-06 15:41:35 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico/ HTTP/1.1" 405 07-06 15:41:35 [INFO] uvicorn | 127.0.0.1:62371 - "GET / HTTP/1.1" 404 07-06 15:41:35 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico HTTP/1.1" 307 07-06 15:41:35 [INFO] uvicorn | 127.0.0.1:62371 - "GET /favicon.ico/ HTTP/1.1" 405

HibiKier commented 3 years ago

pip install playwright,gocq配置是否正确?

Terli commented 3 years ago

Playwright刚安装好,还是访问不了,请问gocq是在8080端口中配置的?在zhenxun_bot配置文件中没找到类似配置文件。

HibiKier commented 3 years ago

https://github.com/Mrs4s/go-cqhttp 下载Releases最新版本,运行后选择反向代理,后将gocq的配置文件config.yml中的universal改为universal: ws://127.0.0.1:8080/cqhttp/ws

Terli commented 3 years ago

连上QQ了,结果疑似风控发不出消息回复信息,不清楚是哪边出了问题了,连上是双击打开go-cqhttp...amd64.exe的,然后启用python bot的,是这个原因吗? image

HibiKier commented 3 years ago

风控是正常现象,新号上线挂机7天

Terli commented 3 years ago

好的,谢谢。

nymanyim commented 3 years ago

群消息风控,私聊正常解决方法:添加设备锁,验证登陆后正常接收

RealKiro commented 3 years ago

群消息风控,私聊正常解决方法:添加设备锁,验证登陆后正常接收

感谢🙏 , 此方法可行