Skip to content

Commit

Permalink
fix: bd
Browse files Browse the repository at this point in the history
  • Loading branch information
Greatwallcorner committed Jul 13, 2024
1 parent 21d3311 commit 701a4c4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
Binary file modified jar/spider.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions json/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"api": "csp_BD",
"searchable": 1,
"changeable": 0,
"ext": {
}
"ext": "aHR0cHM6Ly93d3cueWp5czAyLmNvbS8="
},
{
"key": "NN",
Expand Down
18 changes: 14 additions & 4 deletions src/main/java/com/github/catvod/spider/BD.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ class BD : Spider() {
SpiderDebug.log("BD init session:"+ session)
}

override fun init(extend: String?) {
host = Utils.base64Decode(extend)
SpiderDebug.log("域名:" + host)
init()
}

override fun homeContent(filter: Boolean): String {
val string = OkHttp.string(host, Utils.webHeaders(host, session))
val body = Jsoup.parse(string).body()
Expand All @@ -67,13 +73,14 @@ class BD : Spider() {
con: Element,
vodList: MutableList<Vod>
) {
val cards = con.select("div[class*=card-link]:has(div[class*=ribbon-bookmark])")
val cards = con.select("div[class*=card-link]")
// val cards = con.select("div[class*=card-link]:has(div[class*=ribbon])")
for (card in cards) {
val vod = Vod()
vod.setVodRemarks(card.select("div > div[class*=ribbon]").text())
val cover = card.select("a[class*=cover]")
vod.setVodId(cover.attr("href"))
val img = cover.select("img")
val img = cover.select("a > img")
var pic = img.attr("data-src")
if (pic.isEmpty()) {
pic = img.attr("src")
Expand All @@ -91,8 +98,11 @@ class BD : Spider() {
val url = "$host$tid/$pg"
val string = OkHttp.string(url, Utils.webHeaders(host, session))
val parse = Jsoup.parse(string)
val cons = parse.select("div[class=card-body]")
val list = mutableListOf<Vod>()
getVodList(parse, list)
for (con in cons) {
getVodList(con, list)
}
return Result.string(classList, list)
}

Expand Down Expand Up @@ -311,7 +321,7 @@ class BD : Spider() {
companion object {
private var session: String = ""

private val host = Utils.base64Decode("aHR0cHM6Ly93d3cueWp5czAxLmNvbS8=")
private var host = Utils.base64Decode("aHR0cHM6Ly93d3cueWp5czAxLmNvbS8=")

private val classList =
Class.parseFromFormatStr(Utils.base64Decode("5Yqo5L2cPS9zL2Rvbmd6dW8m54ix5oOFPS9zL2FpcWluZybllpzliac9L3MveGlqdSbnp5Hlubs9L3Mva2VodWFuJuaBkOaAlj0vcy9rb25nYnUm5oiY5LqJPS9zL3poYW56aGVuZybmrabkvqA9L3Mvd3V4aWEm6a2U5bm7PS9zL21vaHVhbibliafmg4U9L3MvanVxaW5nJuWKqOeUuz0vcy9kb25naHVhJuaDiuaCmj0vcy9qaW5nc29uZyYzRD0vcy8zRCbngb7pmr49L3MvemFpbmFuJuaCrOeWkT0vcy94dWFueWkm6K2m5YyqPS9zL2ppbmdmZWkm5paH6Im6PS9zL3dlbnlpJumdkuaYpT0vcy9xaW5nY2h1biblhpLpmak9L3MvbWFveGlhbibniq/nvao9L3MvZmFuenVpJue6quW9lT0vcy9qaWx1JuWPpOijhT0vcy9ndXpodWFuZyblpYflubs9L3MvcWlodWFuJuWbveivrT0vcy9ndW95dSbnu7zoibo9L3Mvem9uZ3lpJuWOhuWPsj0vcy9saXNoaSbov5Dliqg9L3MveXVuZG9uZybljp/liJvljovliLY9L3MveXVhbmNodWFuZybnvo7liac9L3MvbWVpanUm6Z+p5YmnPS9zL2hhbmp1JuWbveS6p+eUteinhuWJpz0vcy9ndW9qdSbml6Xliac9L3MvcmlqdSboi7Hliac9L3MveWluZ2p1JuW+t+WJpz0vcy9kZWp1JuS/hOWJpz0vcy9lanUm5be05YmnPS9zL2JhanUm5Yqg5YmnPS9zL2ppYWp1Juilv+WJpz0vcy9zcGFuaXNoJuaEj+Wkp+WIqeWJpz0vcy95aWRhbGlqdSbms7Dliac9L3MvdGFpanUm5riv5Y+w5YmnPS9zL2dhbmd0YWlqdSbms5Xliac9L3MvZmFqdSbmvrPliac9L3MvYW9qdQ=="))
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/DBTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DBTest {
private val bd: BD = BD()

init {
bd.init()
bd.init("aHR0cHM6Ly93d3cueWp5czAyLmNvbS8=")
}

@Test
Expand Down

0 comments on commit 701a4c4

Please sign in to comment.