mirror of
https://github.com/bizhangjie/CatVodSpider.git
synced 2026-11-04 18:52:12 +00:00
'更新可用状态'
This commit is contained in:
1 parent
18ed57cdf0
commit
633827e839
4 files changed
+4
-45
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 MiMei();
|
spider = new CaoLiu();
|
||||||
spider.init(this, "");
|
spider.init(this, "");
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class CaoLiu extends Spider {
|
|||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final int THREAD_POOL_SIZE = 20;
|
private static final int THREAD_POOL_SIZE = 25;
|
||||||
|
|
||||||
public List<Vod> parseHtml(Document document) {
|
public List<Vod> parseHtml(Document document) {
|
||||||
List<Vod> list = new ArrayList<>();
|
List<Vod> list = new ArrayList<>();
|
||||||
@@ -93,47 +93,6 @@ public class CaoLiu extends Spider {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Vod> parseHtml(String siteUrl, String cookie) {
|
|
||||||
List<Vod> list = new ArrayList<>();
|
|
||||||
ExecutorService executorService = Executors.newFixedThreadPool(THREAD_POOL_SIZE);
|
|
||||||
List<Future<Vod>> futures = new ArrayList<>();
|
|
||||||
|
|
||||||
Document doc = Jsoup.parse(OkHttp.string(siteUrl + "/thread.php?fid=47&page=1",getCookie()));
|
|
||||||
Elements elements = doc.select("div.url_linkkarl");
|
|
||||||
for (Element element : elements) {
|
|
||||||
Future<Vod> future = executorService.submit(() -> {
|
|
||||||
try {
|
|
||||||
String pic = element.select("img").attr("data-aes");
|
|
||||||
String href = element.attr("data-url").replace("read.php?tid=", "").split("&")[0];
|
|
||||||
String name = element.select("h2").text();
|
|
||||||
// 获取图片进行解密
|
|
||||||
String string = OkHttp.string(pic);
|
|
||||||
String picView = aesDecrypt(string);
|
|
||||||
return new Vod(href, name, picView);
|
|
||||||
} catch (Exception e) {
|
|
||||||
// 处理异常情况
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
futures.add(future);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Future<Vod> future : futures) {
|
|
||||||
try {
|
|
||||||
Vod vod = future.get();
|
|
||||||
if (vod != null) {
|
|
||||||
list.add(vod);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
// 处理异常情况
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
executorService.shutdown();
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private static final String IV = "IMGy92137kxhxabI";
|
private static final String IV = "IMGy92137kxhxabI";
|
||||||
private static final String KEY = "I884417AYxOK0123";
|
private static final String KEY = "I884417AYxOK0123";
|
||||||
|
|
||||||
@@ -163,7 +122,7 @@ public class CaoLiu extends Spider {
|
|||||||
for (int i = 0; i < typeNameList.length; i++) {
|
for (int i = 0; i < typeNameList.length; i++) {
|
||||||
classes.add(new Class(typeIdList[i], typeNameList[i]));
|
classes.add(new Class(typeIdList[i], typeNameList[i]));
|
||||||
}
|
}
|
||||||
List<Vod> list = parseHtml(siteUrl,"");
|
List<Vod> list = new ArrayList<>();
|
||||||
return Result.string(classes, list);
|
return Result.string(classes, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -1 +1 @@
|
|||||||
e37bcb2ab7b46627714ff81f9af88009
|
a1efde84a6c7ee3ae6c51c3d87fe629e
|
||||||
Reference in new issue
Block a user