This commit is contained in:
lushunming 2024-08-14 07:45:26 +08:00
parent 28c053e2e5
commit 5293a4f640
6 changed files with 25 additions and 6 deletions

View File

@ -7,6 +7,7 @@ import android.widget.Button;
import com.github.catvod.R; import com.github.catvod.R;
import com.github.catvod.crawler.Spider; import com.github.catvod.crawler.Spider;
import com.github.catvod.spider.Init; import com.github.catvod.spider.Init;
import com.github.catvod.spider.NG;
import com.github.catvod.spider.PTT; import com.github.catvod.spider.PTT;
import com.github.catvod.spider.Zxzj; import com.github.catvod.spider.Zxzj;
import com.orhanobut.logger.AndroidLogAdapter; import com.orhanobut.logger.AndroidLogAdapter;
@ -47,7 +48,7 @@ public class MainActivity extends Activity {
private void initSpider() { private void initSpider() {
try { try {
Init.init(getApplicationContext()); Init.init(getApplicationContext());
spider = new Zxzj(); spider = new NG();
spider.init(this, ""); spider.init(this, "");
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); e.printStackTrace();
@ -75,7 +76,7 @@ public class MainActivity extends Activity {
HashMap<String, String> extend = new HashMap<>(); HashMap<String, String> extend = new HashMap<>();
extend.put("c", "19"); extend.put("c", "19");
extend.put("year", "2024"); extend.put("year", "2024");
Logger.t("categoryContent").d(spider.categoryContent("/list/1.html", "2", true, extend)); Logger.t("categoryContent").d(spider.categoryContent("1", "2", true, extend));
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -73,7 +73,25 @@ public class NG extends Spider {
classList.add(clazz); classList.add(clazz);
} }
} }
return Result.string(classList, filters); Map<String, String> params = new HashMap<>(getParams());
/* for (String s : extend.keySet()) {
params.put(s, URLEncoder.encode(extend.get(s), "UTF-8"));
}*/
params.put("page", "1");
params.put("id", classList.get(0).getTypeId());
String string = OkHttp.string(COMMON_URL + FIND_VIDEO_VOD_LIST, params, getHeaders());
Type type = new TypeToken<Rst<It>>() {
}.getType();
Rst<It> resp = Json.parseSafe(string, type);
List<Vod> vodList = new ArrayList<>();
if (resp != null && resp.isSuccess()) {
for (It it : resp.getList()) {
vodList.add(it.toVod());
}
} else {
SpiderDebug.log("ng cate error: " + string);
}
return Result.string(classList, vodList, filters);
} }
@Override @Override

Binary file not shown.

View File

@ -1 +1 @@
f75b8430b95b293a3c4bc8a624438d93 2fd4e67c5d0b4025572442b8a5df401f

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;f75b8430b95b293a3c4bc8a624438d93", "spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;2fd4e67c5d0b4025572442b8a5df401f",
"lives": [ "lives": [
{ {
"name": "直播ipv6", "name": "直播ipv6",

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;f75b8430b95b293a3c4bc8a624438d93", "spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;2fd4e67c5d0b4025572442b8a5df401f",
"lives": [ "lives": [
{ {
"name": "直播ipv6", "name": "直播ipv6",