Samarium150 / mirai-console-lolicon

基于LoliconAPI的mirai-console插件
GNU Affero General Public License v3.0
203 stars 17 forks source link

fix: create download folder correctly #71

Closed SnowMoonSS closed 2 years ago

SnowMoonSS commented 2 years ago

5.0.0-beta6 图片似乎没有被下载 后台看过了,连download文件夹都没有……

$ ~/n/d/io.github.samarium150.mirai.plugin.mirai-console-lolicon> ls -al
total 12
drwxrwxr-x  2 qqbot qqbot 4096 Dec 30 23:27 ./
drwxrwxr-x 15 qqbot qqbot 4096 Dec 31 00:08 ../
-rw-rw-r--  1 qqbot qqbot  578 Dec 31 00:59 Data.yml
2021-12-31 00:42:06 V/Bot.Bot的QQ号: master的昵称(master的QQ号) -> 涩图 来一张
2021-12-31 00:42:07 I/Lolicon: {"error":"","data":[{"pid":89269572,"p":0,"uid":22628045,"title":"是需要调教的刻晴","author":"糖tou","r18":false,"width":1500,"height":1500,"tags":["原神","Genshin Impact","高品質パンツ","高品质内裤","魅惑の谷間","魅惑的乳沟","丁字裤","揉みしだきたい乳","诱人把玩的乳房","刻晴","Keqing","拘束","束缚","ツインテール","双马尾"],"ext":"jpg","uploadDate":1618853555000,"urls":{"original":"https://i.pixiv.re/img-original/img/2021/04/20/02/32/35/89269572_p0.jpg"}}]}
2021-12-31 00:42:07 V/Bot.Bot的QQ号: Friend(master的QQ号) <- 标题: 是需要调教的刻晴\n作者: 糖tou (uid: 22628045)\n标签: [原神, Genshin Impact, 高品質パンツ, 高品质内裤, 魅惑の谷間, 魅惑的乳沟, 丁字裤, 揉みしだきたい乳, 诱人把玩的乳房, 刻晴, Keqing, 拘束, 束缚, ツインテール, 双马尾]\n链接: https://pixiv.net/artworks/89269572
2021-12-31 00:42:10 E/Lolicon: java.io.FileNotFoundException: /data/io.github.samarium150.mirai.plugin.mirai-console-lolicon/download/89269572_p0.jpg (No such file or directory)
java.io.FileNotFoundException: /data/io.github.samarium150.mirai.plugin.mirai-console-lolicon/download/89269572_p0.jpg (No such file or directory)
        at java.base/java.io.FileOutputStream.open0(Native Method)
        at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:187)
        at kotlin.io.FilesKt__FileReadWriteKt.writeBytes(FileReadWrite.kt:108)
        at io.github.samarium150.mirai.plugin.util.RequestHandlerKt.downloadImage(RequestHandler.kt:62)
        at io.github.samarium150.mirai.plugin.util.RequestHandlerKt$downloadImage$1.invokeSuspend(RequestHandler.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Samarium150 commented 2 years ago

先手动创建download文件夹吧,我看看是什么bug

SnowMoonSS commented 2 years ago

手动创建download也是同样的报错……

Samarium150 commented 2 years ago

手动创建download也是同样的报错……

配置文件里可以把save先改成false

SnowMoonSS commented 2 years ago

手动创建download也是同样的报错……

配置文件里可以把save先改成false

好,图片发出来了,之前没想到是因为存不上图所以发不出来……