diff --git a/app/src/main/java/com/github/catvod/spider/Tg123Search.kt b/app/src/main/java/com/github/catvod/spider/Tg123Search.kt new file mode 100644 index 00000000..27ae3907 --- /dev/null +++ b/app/src/main/java/com/github/catvod/spider/Tg123Search.kt @@ -0,0 +1,56 @@ +package com.github.catvod.spider + +import com.github.catvod.bean.Result +import com.github.catvod.bean.Vod +import com.github.catvod.net.OkHttp +import com.github.catvod.utils.Json +import com.github.catvod.utils.Util +import java.net.URLEncoder +import java.nio.charset.Charset + +/** + * @author zhixc + */ +class Tg123Search : Cloud() { + private val URL = "https://tgsou.252035.xyz/" + + private val header: Map + get() { + val header: MutableMap = HashMap() + header["User-Agent"] = Util.CHROME + return header + } + + + @Throws(Exception::class) + override fun searchContent(key: String, quick: Boolean): String { + val url = + URL + "?channelUsername=wp123zy,xx123pan,yp123pan,zyfb123&pic=true&keyword=" + URLEncoder.encode( + key, Charset.defaultCharset().name() + ) + val list: MutableList = ArrayList() + val html = OkHttp.string(url, header) + val json = Json.safeObject(html); + json["results"].asJsonArray.forEach { element -> + val array = element.asString.split("$$$") + if (array.size >= 2 && array[1].isNotEmpty()) { + array[1].split("##").forEach { + + + val id = it.split("@")[0] + val pic = it.split("@")[1].split("$$")[0] + val name = it.split("@")[1].split("$$")[1] + + list.add(Vod(id, name, pic, "")) + } + + + } + + + } + + + return Result.string(list) + } +} diff --git a/app/src/main/java/com/github/catvod/spider/Tg189Search.kt b/app/src/main/java/com/github/catvod/spider/Tg189Search.kt index 011e435d..e8d7d995 100644 --- a/app/src/main/java/com/github/catvod/spider/Tg189Search.kt +++ b/app/src/main/java/com/github/catvod/spider/Tg189Search.kt @@ -3,8 +3,8 @@ package com.github.catvod.spider import com.github.catvod.bean.Result import com.github.catvod.bean.Vod import com.github.catvod.net.OkHttp +import com.github.catvod.utils.Json import com.github.catvod.utils.Util -import org.jsoup.Jsoup import java.net.URLEncoder import java.nio.charset.Charset @@ -12,7 +12,7 @@ import java.nio.charset.Charset * @author zhixc */ class Tg189Search : Cloud() { - private val URL = "https://tg.252035.xyz/" + private val URL = "https://tgsou.252035.xyz/" private val header: Map get() { @@ -30,16 +30,24 @@ class Tg189Search : Cloud() { ) val list: MutableList = ArrayList() val html = OkHttp.string(url, header) - val arr = html.split(":I".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() - if (arr.isNotEmpty()) { - for (s in arr) { - val doc = Jsoup.parse(s) - val id = doc.select(" a").eachAttr("href") - .first { it.contains("189") || it.contains("139") } - val name=doc.select("strong").text() + val json = Json.safeObject(html); + json["results"].asJsonArray.forEach { element -> + val array = element.asString.split("$$$") + if (array.size >= 2 && array[1].isNotEmpty()) { + array[1].split("##").forEach { + + + val id = it.split("@")[0] + val pic = it.split("@")[1].split("$$")[0] + val name = it.split("@")[1].split("$$")[1] + + list.add(Vod(id, name, pic, "")) + } + - list.add(Vod(id, name, "", "")) } + + } diff --git a/app/src/main/java/com/github/catvod/spider/TgQuarkSearch.kt b/app/src/main/java/com/github/catvod/spider/TgQuarkSearch.kt index 0c5f3442..0ced1d2a 100644 --- a/app/src/main/java/com/github/catvod/spider/TgQuarkSearch.kt +++ b/app/src/main/java/com/github/catvod/spider/TgQuarkSearch.kt @@ -3,8 +3,8 @@ package com.github.catvod.spider import com.github.catvod.bean.Result import com.github.catvod.bean.Vod import com.github.catvod.net.OkHttp +import com.github.catvod.utils.Json import com.github.catvod.utils.Util -import org.jsoup.Jsoup import java.net.URLEncoder import java.nio.charset.Charset @@ -12,12 +12,11 @@ import java.nio.charset.Charset * @author zhixc */ class TgQuarkSearch : Cloud() { - private val URL = "https://tg.252035.xyz/" + private val URL = "https://tgsou.252035.xyz/" private val header: Map get() { - val header: MutableMap = - HashMap() + val header: MutableMap = HashMap() header["User-Agent"] = Util.CHROME return header } @@ -27,23 +26,32 @@ class TgQuarkSearch : Cloud() { override fun searchContent(key: String, quick: Boolean): String { val url = URL + "?channelUsername=alyp_1,clouddriveresources,dianyingshare,hdhhd21,jdjdn1111,leoziyuan,NewQuark,PanjClub,Quark_Movies,xiangxiunb,yunpanchat,yunpanqk,XiangxiuNB,alyp_4K_Movies,alyp_Animation,alyp_TV,alyp_JLP&pic=true&keyword=" + URLEncoder.encode( - key, - Charset.defaultCharset().name() + key, Charset.defaultCharset().name() ) val list: MutableList = ArrayList() val html = OkHttp.string(url, header) - val arr = html.split(":I".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() - if (arr.size > 0) { - for (s in arr) { - val doc = Jsoup.parse(s) - val id = doc.select(" a").eachAttr("href") - .first { it.contains("189") || it.contains("139")|| it.contains("quark") } - val name=doc.select("strong").text() - list.add(Vod(id, name, "", "")) + val json = Json.safeObject(html); + json["results"].asJsonArray.forEach { element -> + val array = element.asString.split("$$$") + if (array.size >= 2 && array[1].isNotEmpty()) { + array[1].split("##").forEach { + + + val id = it.split("@")[0] + val pic = it.split("@")[1].split("$$")[0] + val name = it.split("@")[1].split("$$")[1] + + list.add(Vod(id, name, pic, "")) + } + + } + + } + return Result.string(list) } } diff --git a/app/src/main/java/com/github/catvod/spider/TgbaiduSearch.kt b/app/src/main/java/com/github/catvod/spider/TgbaiduSearch.kt new file mode 100644 index 00000000..6cd186a9 --- /dev/null +++ b/app/src/main/java/com/github/catvod/spider/TgbaiduSearch.kt @@ -0,0 +1,56 @@ +package com.github.catvod.spider + +import com.github.catvod.bean.Result +import com.github.catvod.bean.Vod +import com.github.catvod.net.OkHttp +import com.github.catvod.utils.Json +import com.github.catvod.utils.Util +import java.net.URLEncoder +import java.nio.charset.Charset + +/** + * @author zhixc + */ +class TgbaiduSearch : Cloud() { + private val URL = "https://tgsou.252035.xyz/" + + private val header: Map + get() { + val header: MutableMap = HashMap() + header["User-Agent"] = Util.CHROME + return header + } + + + @Throws(Exception::class) + override fun searchContent(key: String, quick: Boolean): String { + val url = + URL + "?channelUsername=BaiduCloudDisk,bdwpzhpd,Baidu_Netdisk&pic=true&keyword=" + URLEncoder.encode( + key, Charset.defaultCharset().name() + ) + val list: MutableList = ArrayList() + val html = OkHttp.string(url, header) + val json = Json.safeObject(html); + json["results"].asJsonArray.forEach { element -> + val array = element.asString.split("$$$") + if (array.size >= 2 && array[1].isNotEmpty()) { + array[1].split("##").forEach { + + + val id = it.split("@")[0] + val pic = it.split("@")[1].split("$$")[0] + val name = it.split("@")[1].split("$$")[1] + + list.add(Vod(id, name, pic, "")) + } + + + } + + + } + + + return Result.string(list) + } +} diff --git a/app/src/test/java/QuarkTest.java b/app/src/test/java/QuarkTest.java index 3a4cfe0e..039ba4e2 100644 --- a/app/src/test/java/QuarkTest.java +++ b/app/src/test/java/QuarkTest.java @@ -52,7 +52,7 @@ public class QuarkTest { @org.junit.Test public void playerContent() throws Exception { - String content = spider.playerContent("quark原画","a04522f504a742db8ebaf69e3b7f50d6++cf35e6096b5be563ed747a4538ceab60++469c2acf8640++lbhatsGLyszqGYVHwO+DJPeyRkwbsCr7JzcoZhPVYBI=",new ArrayList<>()); + String content = spider.playerContent("quark原画", "a04522f504a742db8ebaf69e3b7f50d6++375807f3f1068a8fdabac127ec4db89f++469c2acf8640++PVTgPNXNtRFDDkE6SAYX4KPSjk9xl449JkTHl6mtu7k=", new ArrayList<>()); System.out.println("playerContent--" + content); JsonObject map = Json.safeObject(content); Gson gson = new GsonBuilder().setPrettyPrinting().create(); diff --git a/json/index.json b/json/index.json index c3107799..adfb3fa4 100644 --- a/json/index.json +++ b/json/index.json @@ -101,7 +101,43 @@ "searchable": 1, "changeable": 1, "ext": {} - }, { + }, + { + "key": "Tg123Search", + "name": "Tg123Search", + "type": 3, + "api": "csp_Tg123Search", + "searchable": 1, + "changeable": 1, + "ext": {} + }, + { + "key": "TgbaiduSearch", + "name": "TgbaiduSearch", + "type": 3, + "api": "csp_TgbaiduSearch", + "searchable": 1, + "changeable": 1, + "ext": {} + }, + { + "key": "Tg189Search", + "name": "Tg189Search", + "type": 3, + "api": "csp_Tg189Search", + "searchable": 1, + "changeable": 1, + "ext": {} + }, + { + "key": "TgQuarkSearch", + "name": "TgQuarkSearch", + "type": 3, + "api": "csp_TgQuarkSearch", + "searchable": 1, + "changeable": 1, + "ext": {} + },{ "key": "TgSearchQuark", "name": "☁TgSearchQuark┃网盘", "type": 3, @@ -110,6 +146,7 @@ "filterable": 0, "ext": { "api_urls": [ + "https://api.jkai.de/api/search", "https://psweb.banye.tech:7777/api/search", "https://so.566987.xyz/api/search", "http://152.69.222.142:8088/api/search" @@ -128,6 +165,7 @@ "filterable": 0, "ext": { "api_urls": [ + "https://api.jkai.de/api/search", "https://psweb.banye.tech:7777/api/search", "https://so.566987.xyz/api/search", "http://152.69.222.142:8088/api/search" @@ -146,6 +184,7 @@ "filterable": 0, "ext": { "api_urls": [ + "https://api.jkai.de/api/search", "https://psweb.banye.tech:7777/api/search", "https://so.566987.xyz/api/search", "http://152.69.222.142:8088/api/search" @@ -164,6 +203,7 @@ "filterable": 0, "ext": { "api_urls": [ + "https://api.jkai.de/api/search", "https://psweb.banye.tech:7777/api/search", "https://so.566987.xyz/api/search", "http://152.69.222.142:8088/api/search" @@ -181,6 +221,7 @@ "filterable": 0, "ext": { "api_urls": [ + "https://api.jkai.de/api/search", "https://psweb.banye.tech:7777/api/search", "https://so.566987.xyz/api/search", "http://152.69.222.142:8088/api/search"