mirror of
https://github.com/bizhangjie/CatVodSpider.git
synced 2026-11-07 04:02:26 +00:00
'更新可用状态'
This commit is contained in:
1 parent
6e59777027
commit
cb32c92baf
5 files changed
+18
-9
No files matched your search
@@ -62,7 +62,7 @@ public class MainActivity extends Activity {
|
|||||||
private void initSpider() {
|
private void initSpider() {
|
||||||
try {
|
try {
|
||||||
Init.init(getApplicationContext());
|
Init.init(getApplicationContext());
|
||||||
spider = new CaoLiu();
|
spider = new MiMei();
|
||||||
spider.init(this, "");
|
spider.init(this, "");
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -87,7 +87,7 @@ public class MainActivity extends Activity {
|
|||||||
|
|
||||||
public void categoryContent() {
|
public void categoryContent() {
|
||||||
try {
|
try {
|
||||||
Logger.t("categoryContent").d(spider.categoryContent("6", "2", true, new HashMap<>()));
|
Logger.t("categoryContent").d(spider.categoryContent("guochan", "2", true, new HashMap<>()));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ public class MainActivity extends Activity {
|
|||||||
|
|
||||||
public void detailContent() {
|
public void detailContent() {
|
||||||
try {
|
try {
|
||||||
Logger.t("detailContent").d(spider.detailContent(Arrays.asList("1716500")));
|
Logger.t("detailContent").d(spider.detailContent(Arrays.asList("/suoyoushipin/guochan/62824.html")));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,12 +103,15 @@ public class CaoLiu extends Spider {
|
|||||||
@Override
|
@Override
|
||||||
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
|
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
|
||||||
String target = cateUrl + tid + "&page=" + pg;
|
String target = cateUrl + tid + "&page=" + pg;
|
||||||
List<Vod> list = new ArrayList<>();
|
|
||||||
// 只有图片模版
|
// 只有图片模版
|
||||||
if (tid == "57") {
|
if (tid == "57") {
|
||||||
Document doc = Jsoup.parse(OkHttp.string(target, getHeaders()));
|
Document doc = Jsoup.parse(OkHttp.string(target, getCookie()));
|
||||||
list = parseHtml(doc);
|
List<Vod> list = parseHtml(doc);
|
||||||
|
Integer total = (Integer.parseInt(pg) + 1) * 20;
|
||||||
|
return Result.string(Integer.parseInt(pg), Integer.parseInt(pg) + 1, 20, total, list);
|
||||||
}
|
}
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
// 图文结合模版
|
// 图文结合模版
|
||||||
if (tid == "47") {
|
if (tid == "47") {
|
||||||
Document doc = Jsoup.parse(OkHttp.string(target, getCookie()));
|
Document doc = Jsoup.parse(OkHttp.string(target, getCookie()));
|
||||||
@@ -131,7 +134,6 @@ public class CaoLiu extends Spider {
|
|||||||
list.add(new Vod(id, name, ""));
|
list.add(new Vod(id, name, ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer total = (Integer.parseInt(pg) + 1) * 20;
|
Integer total = (Integer.parseInt(pg) + 1) * 20;
|
||||||
return Result.string(Integer.parseInt(pg), Integer.parseInt(pg) + 1, 20, total, list);
|
return Result.string(Integer.parseInt(pg), Integer.parseInt(pg) + 1, 20, total, list);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,9 @@ public class MiMei extends Spider {
|
|||||||
String pic = element.select("img").attr("src");
|
String pic = element.select("img").attr("src");
|
||||||
String id = element.select("a").attr("href");
|
String id = element.select("a").attr("href");
|
||||||
String name = element.select("a").attr("title").replace("迷妹推荐--", "");
|
String name = element.select("a").attr("title").replace("迷妹推荐--", "");
|
||||||
|
if (!"".equals(name)) {
|
||||||
list.add(new Vod(id, name, pic));
|
list.add(new Vod(id, name, pic));
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,7 +73,12 @@ public class MiMei extends Spider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
|
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
|
||||||
String target = cateUrl + tid + "/index_" + pg + ".html";
|
String target = cateUrl + tid;
|
||||||
|
if (pg == "1"){
|
||||||
|
target = target + "/";
|
||||||
|
}else {
|
||||||
|
target = target + "/index_" + pg + ".html";
|
||||||
|
}
|
||||||
Document doc = Jsoup.parse(OkHttp.string(target, getHeaders()));
|
Document doc = Jsoup.parse(OkHttp.string(target, getHeaders()));
|
||||||
List<Vod> list = parseHtml(doc);
|
List<Vod> list = parseHtml(doc);
|
||||||
Integer total = (Integer.parseInt(pg) + 1) * 20;
|
Integer total = (Integer.parseInt(pg) + 1) * 20;
|
||||||
|
|||||||
Binary file not shown.
@@ -1 +1 @@
|
|||||||
ef2960a148d277b8b707f32a51a859bd
|
898ae0f1047dd761bb91ed4e31be41f2
|
||||||
Reference in new issue
Block a user