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

写了几个插件,但都遇到些问题。 #12

Open
feiyeyuanye opened this issue Jul 3, 2023 · 9 comments
Open

写了几个插件,但都遇到些问题。 #12

feiyeyuanye opened this issue Jul 3, 2023 · 9 comments

Comments

@feiyeyuanye
Copy link
Contributor

@RyensX
Copy link
Owner

RyensX commented Jul 3, 2023

感谢贡献,三个插件具体问题我晚点再回答。

至于这个自定义Page传递参数,我晚上回去更新一下API,之前其实预留了一些地方支持但是几个插件没用到就忘了

@feiyeyuanye
Copy link
Contributor Author

好的,谢谢,大多都是美观的问题,并不急,什么时候看都可以。

@RyensX
Copy link
Owner

RyensX commented Jul 4, 2023

已经在测试版更新对自定义参数的支持(ICustomPageDataComponent::initPage),你可以在测试版先试试,记得更新api

@feiyeyuanye
Copy link
Contributor Author

自定义参数已经实现,不过感觉函数的调用的顺序不太舒服,我是通过迭代实现的,现在为 :
getData -》initPage -》getData。感觉也可以。

代码如下:
https://github.com/feiyeyuanye/AnFunsAnimePlugin/blob/main/app/src/main/java/com/jhr/anfunsanimeplugin/plugin/components/TdetailPageDataComponent.kt

顺便问一下:很多网站在搜索的时候会需要验证码,能解决么?我这样尝试了一下,但不行:
网站:https://www.freeok.me/search/%E9%BE%99----------1---.html

    override suspend fun getSearchData(keyWord: String, page: Int): List<BaseData> {
        val searchResultList = mutableListOf<BaseData>()

        val url = "${host}/search/${keyWord}----------${page}---.html"
        Log.e("TAG", url)

        val document = JsoupUtil.getDocument(url)
        Log.e("TAG", "$document")
        if (document.select("title").text() == "系统安全验证"){
            CookieManager.getInstance().setCookie(host, "")
            WebBrowserAction.obtain(url,
                loadPolicy = object :
                    WebUtil.LoadPolicy by WebUtil.DefaultLoadPolicy {
                    override val userAgentString = Const.ua
                }).go(AppUtil.appContext)
            throw RuntimeException("请在验证结束后点击左上角返回,然后下拉刷新")
        }

        searchResultList.addAll(ParseHtmlUtil.parseSearchEm(document, url))
        return searchResultList
    }

@RyensX
Copy link
Owner

RyensX commented Jul 4, 2023

之前没有电脑仔细看代码,现在已经修正调用时机了,可以下载测试版看看。

关于验证码,目前暂时还没有提供相应工具一键解决,后面新版出来再处理一下

@RyensX
Copy link
Owner

RyensX commented Jul 4, 2023

另外你写的几个插件,有比较完善的都可以先提交上来了

@feiyeyuanye
Copy link
Contributor Author

ok👌

@feiyeyuanye
Copy link
Contributor Author

一些网站,通过 JsoupUtil.getDocument(url) 得到的数据是不全的。我想要延迟两秒再获取网页内容,有什么办法么?

@RyensX
Copy link
Owner

RyensX commented Jul 15, 2023

一些网站,通过 JsoupUtil.getDocument(url) 得到的数据是不全的。我想要延迟两秒再获取网页内容,有什么办法么?

看看WebUtil,可以直接获取动态网页源码,樱花2用的就很多

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