一款简单网页截图插件
-
网页截图
基于 mirai-selenium-plugin的 网页截图插件
项目地址:https://github.com/liuqianpan2008/imageplugin
使用前准备
请确保以上文档熟知阅读。
请确保mirai-core版本在2.10.0-RC2及其以上。
请确保前置插件的安装以及版本在Release v2.0.5 及以上
指令
(/) 截图 <url>
描述:会对当前网页进行一次长截图(部分暂响应式布局网站不支持)
权限点:
org.imageplugin:command.截图
效果图:
(/) 站长工具
数据来源 chinaz.com
权限点:
org.imageplugin:command.站长工具
- (/) 站长工具 ping <url>
描述:查询当前网站ping值
效果图:
- (/) 站长工具 备案 <url>
无备案状态后台会进行报错,前台不会输出报错
描述:查询当前网站备案情况(存在缓存)
效果图:
- (/) 站长工具 ECO <url>
描述:查询当前网站综合收录情况
效果图:
(/) 站长工具 ip <url>
描述:查询当前网站IP地址归宿地
效果图:
安装
- 运行 Mirai Console 生成
plugins
文件夹 - 从Releases下载
jar
并将其放入plugins
文件夹中
-
好的,加载插件直接红了
-
@白嫖怪林先生 什么报错?可以发下吗
-
@白嫖怪林先生 在 一款简单网页截图插件 中说:
好的,加载插件直接红了
-
提供完整报错截图(血压上升中
-
@qq924579441 请去log(./bots/QQ号/log)文件下发送完整日志。
-
2022-02-06 18:01:55 V/Bot.机器人QQ号: Group(723944162) <- 正在截图。。。请稍等
2022-02-06 18:01:56 W/stderr: Exception in thread "Thread-61" java.lang.IllegalArgumentException: Unknown HttpClient factory ktor
2022-02-06 18:01:56 W/stderr: at org.openqa.selenium.remote.http.HttpClient$Factory.create(HttpClient.java:57)
2022-02-06 18:01:56 W/stderr: at org.openqa.selenium.remote.http.HttpClient$Factory.createDefault(HttpClient.java:73)
2022-02-06 18:01:56 W/stderr: at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:95)
2022-02-06 18:01:56 W/stderr: at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:99)
2022-02-06 18:01:56 W/stderr: at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:86)
2022-02-06 18:01:56 W/stderr: at xyz.cssxsh.selenium.SeleniumInitKt$setupChromeDriver$2.invoke(SeleniumInit.kt:391)
2022-02-06 18:01:56 W/stderr: at xyz.cssxsh.selenium.SeleniumInitKt$setupChromeDriver$2.invoke(SeleniumInit.kt:375)
2022-02-06 18:01:56 W/stderr: at xyz.cssxsh.selenium.SeleniumToolKt.RemoteWebDriver(SeleniumTool.kt:74)
2022-02-06 18:01:56 W/stderr: at xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin.driver(MiraiSeleniumPlugin.kt:57)
2022-02-06 18:01:56 W/stderr: at org.Command.PhantomTools.lambda$onCommand$0(PhantomTools.java:37)
2022-02-06 18:01:56 W/stderr: at java.base/java.lang.Thread.run(Unknown Source) -
@greenchennai
是不是安装了mirai-login-solver-selenium
?
插件有冲突 -
@cssxsh 并没有qwq
-
折腾一会儿还是报错
配置文件内的参数都改过尝试了
浏览器也从谷歌换成了火狐
2022-02-07 10:54:58 W/stderr: Exception in thread "Thread-49" java.lang.ExceptionInInitializerError
2022-02-07 10:54:58 W/stderr: at org.openqa.selenium.remote.HttpCommandExecutor.getDefaultClientFactory(HttpCommandExecutor.java:62)
2022-02-07 10:54:58 W/stderr: at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:87)
2022-02-07 10:54:58 W/stderr: at org.openqa.selenium.remote.service.DriverCommandExecutor.<init>(DriverCommandExecutor.java:77)
2022-02-07 10:54:58 W/stderr: at org.openqa.selenium.firefox.FirefoxDriver$FirefoxDriverCommandExecutor.<init>(FirefoxDriver.java:160)
2022-02-07 10:54:58 W/stderr: at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:201)
2022-02-07 10:54:58 W/stderr: at xyz.cssxsh.selenium.SeleniumInitKt$setupFirefoxDriver$3.invoke(SeleniumInit.kt:470)
2022-02-07 10:54:58 W/stderr: at xyz.cssxsh.selenium.SeleniumInitKt$setupFirefoxDriver$3.invoke(SeleniumInit.kt:456)
2022-02-07 10:54:58 W/stderr: at xyz.cssxsh.selenium.SeleniumToolKt.RemoteWebDriver(SeleniumTool.kt:74)
2022-02-07 10:54:58 W/stderr: at xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin.driver(MiraiSeleniumPlugin.kt:57)
2022-02-07 10:54:58 W/stderr: at org.Command.PhantomTools.lambda$onCommand$0(PhantomTools.java:37)
2022-02-07 10:54:58 W/stderr: at java.base/java.lang.Thread.run(Unknown Source)
2022-02-07 10:54:58 W/stderr: Caused by: java.lang.IllegalArgumentException: Unknown HttpClient factory netty
2022-02-07 10:54:58 W/stderr: at org.openqa.selenium.remote.http.HttpClient$Factory.create(HttpClient.java:57)
2022-02-07 10:54:58 W/stderr: at org.openqa.selenium.remote.http.HttpClient$Factory.createDefault(HttpClient.java:73)
2022-02-07 10:54:58 W/stderr: at org.openqa.selenium.remote.HttpCommandExecutor$DefaultClientFactoryHolder.<clinit>(HttpCommandExecutor.java:58)
2022-02-07 10:54:58 W/stderr: ... 11 more -
@greenchennai
bilibili-helper 升级一下,旧版本 和 mirai-selenium 冲突了 -
@cssxsh 是了,qwq没想到还有这一层
-
请问此插件的启用权限配置指令是不是“/perm permit u* org.imageplugin:command.截图”?
我使用上面的指令配置完权限之后,群内发送指令“截图 baidu.com”却没有任何回复(包括控制台里面也没有本插件响应的日志),我可以确定的是,插件是成功启动运行了的(见最下面的日志),所以想问一下是不是权限问题。
2022-03-01 23:53:41 V/JvmPluginLoader: Enabling plugin imageplugin v1.0
2022-03-01 23:53:41 I/imageplugin: 网页截图插件已加载
2022-03-01 23:53:41 V/JvmPluginLoader: Enabled plugin imageplugin v1.0
2022-03-01 23:53:41 I/main: 9 plugin(s) enabled. -
加载没问题,权限给了发生报错
环境:
mirai version 1.2.2-60c67fb
java 17
windows sever 2019
log:[92m2022-03-20 03:06:33 I/main: mirai-console started successfully.[0m[m
[0m2022-03-20 03:07:42 V/Bot.20428: [Mirai(6555)] 用Gsx(27262) -> 截图 https://baidu.com[0m[m
[0m2022-03-20 03:07:42 V/Bot.2058: Group(655) <- 正在截图。。。请稍等[0m[m
[91m2022-03-20 03:07:53 W/stderr: Exception in thread "Thread-17" java.lang.LinkageError: loader constraint violation: when resolving method 'org.openqa.selenium.remote.RemoteWebDriver xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin.driver(xyz.cssxsh.selenium.RemoteWebDriverConfig)' the class loader 'imageplugin-1.0-SNAPSHOT.mirai.jar' @15639440 of the current class, org/Command/PhantomTools, and the class loader 'mirai-selenium-plugin-2.0.7.mirai.jar' @733aa9d8 for the method's defining class, xyz/cssxsh/mirai/plugin/MiraiSeleniumPlugin, have different Class objects for the type xyz/cssxsh/selenium/RemoteWebDriverConfig used in the signature (org.Command.PhantomTools is in unnamed module of loader 'imageplugin-1.0-SNAPSHOT.mirai.jar' @15639440, parent loader net.mamoe.mirai.console.internal.plugin.DynLibClassLoader @28501a4b; xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin is in unnamed module of loader 'mirai-selenium-plugin-2.0.7.mirai.jar' @733aa9d8, parent loader net.mamoe.mirai.console.internal.plugin.DynLibClassLoader @28501a4b)
[0m[m
[91m2022-03-20 03:07:53 W/stderr: at imageplugin-1.0-SNAPSHOT.mirai.jar//org.Command.PhantomTools.lambda$onCommand$0(PhantomTools.java:37)
[0m[m
[91m2022-03-20 03:07:53 W/stderr: at java.base/java.lang.Thread.run(Thread.java:833)
[0m[m -
@gatesx-0 问题是Mirai 2.11.0-M1有bug
-
能不能帮我看一下我这个报错,用不了,哎
2022-07-12 23:58:52 V/Bot.123456: 星星?(123456) -> 截图 https://b23.tv/E8NuAUc
2022-07-12 23:58:52 V/Bot.123456: Friend(123456) <- 正在截图。。。请稍等
2022-07-12 23:58:52 W/stderr: Exception in thread "Thread-25" java.lang.LinkageError: loader constraint violation: when resolving method 'org.openqa.selenium.remote.RemoteWebDriver xyz.cssxsh.selenium.SeleniumToolKt.RemoteWebDriver(xyz.cssxsh.selenium.RemoteWebDriverConfig)' the class loader 'imagepluginv0.0.3.jar' @1b76b60 of the current class, xyz/cssxsh/mirai/plugin/MiraiSeleniumPlugin, and the class loader 'mirai-selenium-plugin-2.2.0.mirai2.jar' @1953e3 for the method's defining class, xyz/cssxsh/selenium/SeleniumToolKt, have different Class objects for the type xyz/cssxsh/selenium/RemoteWebDriverConfig used in the signature (xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin is in unnamed module of loader 'imagepluginv0.0.3.jar' @1b76b60, parent loader net.mamoe.mirai.console.internal.plugin.DynLibClassLoader @100d047; xyz.cssxsh.selenium.SeleniumToolKt is in unnamed module of loader 'mirai-selenium-plugin-2.2.0.mirai2.jar' @1953e3, parent loader net.mamoe.mirai.console.internal.plugin.DynLibClassLoader @100d047)
2022-07-12 23:58:52 W/stderr: at imagepluginv0.0.3.jar//xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin.driver(MiraiSeleniumPlugin.kt:57)
2022-07-12 23:58:52 W/stderr: at imagepluginv0.0.3.jar//org.Command.PhantomTools.lambda$onCommand$0(PhantomTools.java:37)
2022-07-12 23:58:52 W/stderr: at java.base/java.lang.Thread.run(Unknown Source) -
2022-07-26 19:00:07 W/stderr: Exception in thread "Thread-38" java.lang.LinkageError: loader constraint violation: when resolving method 'org.openqa.selenium.remote.RemoteWebDriver xyz.cssxsh.selenium.SeleniumToolKt.RemoteWebDriver(xyz.cssxsh.selenium.RemoteWebDriverConfig)' the class loader 'imagepluginv0.0.3 (1).jar' @3af7d855 of the current class, xyz/cssxsh/mirai/plugin/MiraiSeleniumPlugin, and the class loader 'mirai-selenium-plugin-2.2.1.mirai2.jar' @80bfa9d for the method's defining class, xyz/cssxsh/selenium/SeleniumToolKt, have different Class objects for the type xyz/cssxsh/selenium/RemoteWebDriverConfig used in the signature (xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin is in unnamed module of loader 'imagepluginv0.0.3 (1).jar' @3af7d855, parent loader 'global-shared' @6a0094c9; xyz.cssxsh.selenium.SeleniumToolKt is in unnamed module of loader 'mirai-selenium-plugin-2.2.1.mirai2.jar' @80bfa9d, parent loader 'global-shared' @6a0094c9)
2022-07-26 19:00:07 W/stderr: at imagepluginv0.0.3 (1).jar//xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin.driver(MiraiSeleniumPlugin.kt:57)
2022-07-26 19:00:07 W/stderr: at imagepluginv0.0.3 (1).jar//org.Command.PhantomTools.lambda$onCommand$0(PhantomTools.java:37)
2022-07-26 19:00:07 W/stderr: at java.base/java.lang.Thread.run(Thread.java:833) -
啥错误
2023-01-06 16:43:18 W/stderr: Exception in thread "Thread-34" java.lang.LinkageError: loader constraint violation: when resolving method 'org.openqa.selenium.remote.RemoteWebDriver xyz.cssxsh.selenium.SeleniumToolKt.RemoteWebDriver(xyz.cssxsh.selenium.RemoteWebDriverConfig)' the class loader 'imagepluginv0.0.3.jar' @40de8f93 of the current class, xyz/cssxsh/mirai/plugin/MiraiSeleniumPlugin, and the class loader 'mirai-selenium-plugin-2.2.5.mirai2.jar' @1319bc2a for the method's defining class, xyz/cssxsh/selenium/SeleniumToolKt, have different Class objects for the type xyz/cssxsh/selenium/RemoteWebDriverConfig used in the signature (xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin is in unnamed module of loader 'imagepluginv0.0.3.jar' @40de8f93, parent loader 'global-shared' @a5272be; xyz.cssxsh.selenium.SeleniumToolKt is in unnamed module of loader 'mirai-selenium-plugin-2.2.5.mirai2.jar' @1319bc2a, parent loader 'global-shared' @a5272be) 2023-01-06 16:43:18 W/stderr: at imagepluginv0.0.3.jar//xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin.driver(MiraiSeleniumPlugin.kt:57) 2023-01-06 16:43:18 W/stderr: at imagepluginv0.0.3.jar//org.Command.PhantomTools.lambda$onCommand$0(PhantomTools.java:37) 2023-01-06 16:43:18 W/stderr: at java.base/java.lang.Thread.run(Thread.java:833)
-
报错异常,这种啥错误
Exception in thread "Thread-26" java.lang.LinkageError: loader constraint violation: when resolving method 'org.openqa.selenium.remote.RemoteWebDriver xyz.cssxsh.selenium.SeleniumToolKt.RemoteWebDriver(xyz.cssxsh.selenium.RemoteWebDriverConfig)' the class loader 'imagepluginv0.0.3.jar' @415795f3 of the current class, xyz/cssxsh/mirai/plugin/MiraiSeleniumPlugin, and the class loader 'mirai-selenium-plugin-2.2.5.mirai2.jar' @5e50df2e for the method's defining class, xyz/cssxsh/selenium/SeleniumToolKt, have different Class objects for the type xyz/cssxsh/selenium/RemoteWebDriverConfig used in the signature (xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin is in unnamed module of loader 'imagepluginv0.0.3.jar' @415795f3, parent loader 'global-shared' @4e224df5; xyz.cssxsh.selenium.SeleniumToolKt is in unnamed module of loader 'mirai-selenium-plugin-2.2.5.mirai2.jar' @5e50df2e, parent loader 'global-shared' @4e224df5)
at imagepluginv0.0.3.jar//xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin.driver(MiraiSeleniumPlugin.kt:57)
at imagepluginv0.0.3.jar//org.Command.PhantomTools.lambda$onCommand$0(PhantomTools.java:37)
at java.base/java.lang.Thread.run(Thread.java:833) -
发送截图命令瞬间报错,这是怎么回事?
mirai-core版本2.13.2,seleium前置也是最新的
浏览器设置的edge
日志如下2023-01-31 14:51:05 V/Bot.1705609074: [没名字的群就是好群(1061257810)] (2098581065) -> /截图 baidu.com 2023-01-31 14:51:05 I/stdout: RobotConfig.enableRobot = true 2023-01-31 14:51:05 I/stdout: 14:51:05.095 [DefaultDispatcher-worker-9] DEBUG org.ktorm.database - SQL: INSERT INTO wordcloud (sender_id, group_id, content, "time") VALUES (?, ?, ?, ?) 2023-01-31 14:51:05 I/stdout: 14:51:05.097 [DefaultDispatcher-worker-9] DEBUG org.ktorm.database - Parameters: [2098581065(bigint), 1061257810(bigint), /��ͼ baidu.com(text), 2023-01-31(date)] 2023-01-31 14:51:05 I/stdout: 14:51:05.115 [DefaultDispatcher-worker-9] DEBUG org.ktorm.database - Effects: 1 2023-01-31 14:51:05 V/Bot.1705609074: Group(1061257810) <- 正在截图。。。请稍等 2023-01-31 14:51:05 W/stderr: Exception in thread "Thread-11527" java.lang.LinkageError: loader constraint violation: when resolving method "xyz.cssxsh.selenium.SeleniumToolKt.RemoteWebDriver(Lxyz/cssxsh/selenium/RemoteWebDriverConfig;)Lorg/openqa/selenium/remote/RemoteWebDriver;" the class loader 'imagepluginv0.0.3.jar' @7fedb795 (instance of net.mamoe.mirai.console.internal.plugin.JvmPluginClassLoaderN, child of 'global-shared' @52b3bf03 net.mamoe.mirai.console.internal.plugin.DynLibClassLoader) of the current class, xyz/cssxsh/mirai/plugin/MiraiSeleniumPlugin, and the class loader 'mirai-selenium-plugin-2.2.5.mirai2.jar' @19fd43da (instance of net.mamoe.mirai.console.internal.plugin.JvmPluginClassLoaderN, child of 'global-shared' @52b3bf03 net.mamoe.mirai.console.internal.plugin.DynLibClassLoader) for the method's defining class, xyz/cssxsh/selenium/SeleniumToolKt, have different Class objects for the type xyz/cssxsh/selenium/RemoteWebDriverConfig used in the signature 2023-01-31 14:51:05 W/stderr: at imagepluginv0.0.3.jar//xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin.driver(MiraiSeleniumPlugin.kt:57) 2023-01-31 14:51:05 W/stderr: at imagepluginv0.0.3.jar//org.Command.PhantomTools.lambda$onCommand$0(PhantomTools.java:37) 2023-01-31 14:51:05 W/stderr: at java.base/java.lang.Thread.run(Thread.java:834)