Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centos8+miraiOK+CQHTTPMirai环境 处理图片报错 #7

Closed
OmaruPolka opened this issue Aug 18, 2020 · 8 comments
Closed

Centos8+miraiOK+CQHTTPMirai环境 处理图片报错 #7

OmaruPolka opened this issue Aug 18, 2020 · 8 comments

Comments

@OmaruPolka
Copy link

OmaruPolka commented Aug 18, 2020

RT,单文件文字条件下正常发出消息,有图片时无法发出.
Centos8+miraiOK+CQHTTPMirai环境

Potential WorkAround:

Delete Line 208 & 209 in include/plugins/RSSHub/rsshub.py
208 - imgs_name = re.sub(r'\', r'\\', imgs_name)
209 - imgs_name = re.sub(r'/', r'\\', imgs_name)

LOG for ELF_RSS:

[2020-08-18 18:14:30,840 nonebot] INFO: 检查 test 更新
26
27

【💙配信告知💙】
🐕【雀魂公認】#くまたま〜じゃん-初心者犬山たまきが麻雀入門-【犬山たまき/熊谷タクマ】
🐕8月18日23時~24時
まさかの雀魂公認⁉️
犬山たまきの初心者麻雀企画がスタート🐶💙
くまくまに教わりながら楽しく麻雀やります🀄✨
配信タグ▶#くまたま~じゃん https://www.youtube.com/channel/UC8NZiqKx6fsDT3AVcMiVFyA/
[CQ:image,file=file:///\home\hakumio\ELF_RSS\data\imgs\49107c08-e196-43e6-acfc-6cfd6bac5016.jpg]
翻译:
[ 分布信号告诉知识 ]
[麻雀灵魂 PUBLIC 确认] #相当或是或〜季雅 n - 退房手续第一心脏用户狗山是或 有 ASA 麻雀输入门 - - 狗山是或退房手续 / 熊山谷 DATA 点击马]
8 18月 23日期时间 24 时间
或者的或 麻雀灵魂公共确定
狗山是或的退房手续首次心脏用户 ASA 麻雀企业图片 扫描 DATA 在门
相反或而或到教学“在一个是等音乐到而非 ASA 麻雀和在或到 S
分布信号数据灰色 #而或是或〜籍雅 n
[2020-08-18 18:14:40,095 nonebot] ERROR: QQ号960949576不合法或者不是好友 E:

LOG for MiraiOK (with CQHTTPMirai)

18:14:40 [ERROR] [CQHTTPMirai] java.net.URISyntaxException: Illegal character in path at index 6: file:/\home\hakumio\ELF_RSS\data\imgs\49107c08-e196-43e6-acfc-6cfd6bac5016.jpg
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.checkChars(URI.java:3021)
at java.net.URI$Parser.parseHierarchical(URI.java:3105)
at java.net.URI$Parser.parse(URI.java:3053)
at java.net.URI.(URI.java:588)
at java.net.URL.toURI(URL.java:964)
at tech.mihoyo.mirai.util.CQMessgeParserKt$tryResolveMedia$2.invokeSuspend(CQMessgeParser.kt:338)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

@Quan666
Copy link
Owner

Quan666 commented Aug 19, 2020

请将此处设置为:True

IsLinux=False # 如果你是Linux部署的,即使用了 docker 部署,请打开此项并设置 Linux_Path

此处设置为:/home/hakumio/ELF_RSS/data/imgs/49107c08-e196-43e6-acfc-6cfd6bac5016.jpg

Linux_Path='' # 部署环境为Linux时 wine下插件存放目录 如 Z:\\home\\user\\coolq\\ELF_RSS\\ 需要以“\\”结尾 注意路径的“/” 需要换成“\\”

@OmaruPolka
Copy link
Author

您好 重置include/plugins/RSSHub/rsshub.py并按照您提供的方法修改后运行时仍有报错

且此时管理员命令没有返回任何结果

LOG for ELF_RSS

[hakumio@localhost ELF_RSS]$ hypercorn run:app -b 0.0.0.0:65080
Running on 0.0.0.0:65080 over http (CTRL + C to quit)
ujson module not found, using json
msgpack not installed, MsgPackSerializer unavailable
[2020-08-19 10:34:08,601 nonebot] INFO: Succeeded to import "nonebot.plugins.base"
[2020-08-19 10:34:08,602 nonebot] INFO: Succeeded to import "include.plugins.RSSHub"
[2020-08-19 10:34:08,632 nonebot] ERROR: Failed to import "include.plugins.add_dy", error: unexpected character after line continuation character (rsshub.py, line 207)
[2020-08-19 10:34:08,632 nonebot] ERROR: unexpected character after line continuation character (rsshub.py, line 207)
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/nonebot/plugin.py", line 31, in load_plugin
module = importlib.import_module(module_name)
File "/usr/lib64/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/hakumio/ELF_RSS/include/plugins/add_dy.py", line 3, in
from .RSSHub import rsshub
File "/home/hakumio/ELF_RSS/include/plugins/RSSHub/rsshub.py", line 207
imgs_name = re.sub(r'', r'\', imgs_name)
^
SyntaxError: unexpected character after line continuation character
[2020-08-19 10:34:08,634 nonebot] ERROR: Failed to import "include.plugins.change_dy", error: unexpected character after line continuation character (rsshub.py, line 207)
[2020-08-19 10:34:08,634 nonebot] ERROR: unexpected character after line continuation character (rsshub.py, line 207)
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/nonebot/plugin.py", line 31, in load_plugin
module = importlib.import_module(module_name)
File "/usr/lib64/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/hakumio/ELF_RSS/include/plugins/change_dy.py", line 3, in
from .RSSHub import rsshub
File "/home/hakumio/ELF_RSS/include/plugins/RSSHub/rsshub.py", line 207
imgs_name = re.sub(r'', r'\', imgs_name)
^
SyntaxError: unexpected character after line continuation character
[2020-08-19 10:34:08,636 nonebot] ERROR: Failed to import "include.plugins.del_dy", error: unexpected character after line continuation character (rsshub.py, line 207)
[2020-08-19 10:34:08,636 nonebot] ERROR: unexpected character after line continuation character (rsshub.py, line 207)
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/nonebot/plugin.py", line 31, in load_plugin
module = importlib.import_module(module_name)
File "/usr/lib64/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/hakumio/ELF_RSS/include/plugins/del_dy.py", line 3, in
from .RSSHub import rsshub
File "/home/hakumio/ELF_RSS/include/plugins/RSSHub/rsshub.py", line 207
imgs_name = re.sub(r'', r'\', imgs_name)
^
SyntaxError: unexpected character after line continuation character
[2020-08-19 10:34:08,636 nonebot] INFO: Succeeded to import "include.plugins.iurls"
[2020-08-19 10:34:08,638 nonebot] ERROR: Failed to import "include.plugins.show_all", error: unexpected character after line continuation character (rsshub.py, line 207)
[2020-08-19 10:34:08,638 nonebot] ERROR: unexpected character after line continuation character (rsshub.py, line 207)
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/nonebot/plugin.py", line 31, in load_plugin
module = importlib.import_module(module_name)
File "/usr/lib64/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/hakumio/ELF_RSS/include/plugins/show_all.py", line 3, in
from .RSSHub import rsshub
File "/home/hakumio/ELF_RSS/include/plugins/RSSHub/rsshub.py", line 207
imgs_name = re.sub(r'', r'\', imgs_name)
^
SyntaxError: unexpected character after line continuation character
[2020-08-19 10:34:08,639 nonebot] ERROR: Failed to import "include.plugins.show_dy", error: unexpected character after line continuation character (rsshub.py, line 207)
[2020-08-19 10:34:08,639 nonebot] ERROR: unexpected character after line continuation character (rsshub.py, line 207)
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/nonebot/plugin.py", line 31, in load_plugin
module = importlib.import_module(module_name)
File "/usr/lib64/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/hakumio/ELF_RSS/include/plugins/show_dy.py", line 3, in
from .RSSHub import rsshub
File "/home/hakumio/ELF_RSS/include/plugins/RSSHub/rsshub.py", line 207
imgs_name = re.sub(r'', r'\', imgs_name)
^
SyntaxError: unexpected character after line continuation character
[2020-08-19 10:34:08,641 nonebot] ERROR: Failed to import "include.plugins.start", error: unexpected character after line continuation character (rsshub.py, line 207)
[2020-08-19 10:34:08,641 nonebot] ERROR: unexpected character after line continuation character (rsshub.py, line 207)
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/nonebot/plugin.py", line 31, in load_plugin
module = importlib.import_module(module_name)
File "/usr/lib64/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/hakumio/ELF_RSS/include/plugins/start.py", line 1, in
from .RSSHub import rsstrigger as RT
File "/home/hakumio/ELF_RSS/include/plugins/RSSHub/rsstrigger.py", line 4, in
from . import rsshub
File "/home/hakumio/ELF_RSS/include/plugins/RSSHub/rsshub.py", line 207
imgs_name = re.sub(r'', r'\', imgs_name)
^
SyntaxError: unexpected character after line continuation character
[2020-08-19 10:34:08,643 nonebot] INFO: Scheduler started

[2020-08-19 10:37:10,005 nonebot] INFO: Self: 2143711880, Message 699 from 960949576@[群:604956182]: Polka show_all

LOG for Mirai

10:37:10 [INFO] [BOT 2143711880] [TPNP for Mirai开发群(604956182)] 神楽坂アリア(960949576) -> [mirai:source:699,-513247136]Polka show_all

@Quan666
Copy link
Owner

Quan666 commented Aug 19, 2020

请问你修改的是哪个文件?

@OmaruPolka
Copy link
Author

我现在正常发送图片的方法是删除了include/plugins/RSSHub/rsshub.py的208-209行
(应该是关于文件名编写的部分,没有对在linux系统直接运行的miraiOK做适配?)

刚才继续报错的是把include/plugins/RSSHub/rsshub.py重置回master分支,然后按建议修改config.py

@Quan666
Copy link
Owner

Quan666 commented Aug 19, 2020

配置文件里面改为这个试试:/home/hakumio/ELF_RSS/
如果还是报错就把 “/” 改成 “//”

@OmaruPolka
Copy link
Author

无论 LinuxPath 修改为 /home/hakumio/ELF_RSS/ 还是 //home//hakumio//ELF_RSS//
仍然报SyntaxError 定位依旧是rsshub.py Line 207
Log同上: #7 (comment)

@Quan666
Copy link
Owner

Quan666 commented Aug 19, 2020

那你把isLinux改回false
顺便Python升级到3.8

@Quan666
Copy link
Owner

Quan666 commented Aug 19, 2020

已经适配Linux dbac533
请更新最新版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants