Fix doll and alist search

This commit is contained in:
FongMi 2023-09-26 09:19:46 +08:00
parent 0346cfe31a
commit 1688807361
4 changed files with 13 additions and 18 deletions

View File

@ -250,12 +250,16 @@ public class AList extends Spider {
} }
@Override @Override
public List<Vod> call() throws Exception { public List<Vod> call() {
List<Vod> list = new ArrayList<>(); try {
String response = post(drive, drive.searchApi(), drive.params(keyword)); List<Vod> list = new ArrayList<>();
List<Item> items = Item.arrayFrom(getSearchJson(drive.isNew(), response)); String response = post(drive, drive.searchApi(), drive.params(keyword));
for (Item item : items) if (!item.ignore(drive.isNew())) list.add(item.getVod(drive, vodPic)); List<Item> items = Item.arrayFrom(getSearchJson(drive.isNew(), response));
return list; for (Item item : items) if (!item.ignore(drive.isNew())) list.add(item.getVod(drive, vodPic));
return list;
} catch (Exception e) {
return Collections.emptyList();
}
} }
} }
} }

View File

@ -1,19 +1,15 @@
package com.github.catvod.spider; package com.github.catvod.spider;
import android.util.Base64;
import com.github.catvod.bean.Class; import com.github.catvod.bean.Class;
import com.github.catvod.bean.Result; import com.github.catvod.bean.Result;
import com.github.catvod.bean.Vod; import com.github.catvod.bean.Vod;
import com.github.catvod.crawler.Spider; import com.github.catvod.crawler.Spider;
import com.github.catvod.net.OkHttp; import com.github.catvod.net.OkHttp;
import com.github.catvod.utils.Utils;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element; import org.jsoup.nodes.Element;
import java.net.URLDecoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -61,24 +57,19 @@ public class Doll extends Spider {
public String detailContent(List<String> ids) throws Exception { public String detailContent(List<String> ids) throws Exception {
String html = OkHttp.string(url + ids.get(0)); String html = OkHttp.string(url + ids.get(0));
Document doc = Jsoup.parse(html); Document doc = Jsoup.parse(html);
StringBuilder sb = new StringBuilder();
String videoId = ids.get(0).split("/")[1].split("\\.")[0];
String pic = doc.select("meta[property=og:image]").attr("content"); String pic = doc.select("meta[property=og:image]").attr("content");
String name = doc.select("meta[property=og:title]").attr("content"); String name = doc.select("meta[property=og:title]").attr("content");
String voteTag = new String(Base64.decode(Utils.getVar(html, "voteTag").getBytes(), 0));
for (int i = 0; i < voteTag.length(); i++) sb.append(Character.toChars(voteTag.charAt(i) ^ videoId.charAt(i % videoId.length())));
String playUrl = URLDecoder.decode(new String(Base64.decode(sb.toString().getBytes(), 0)));
Vod vod = new Vod(); Vod vod = new Vod();
vod.setVodId(ids.get(0)); vod.setVodId(ids.get(0));
vod.setVodPic(pic); vod.setVodPic(pic);
vod.setVodName(name); vod.setVodName(name);
vod.setVodPlayFrom("玩偶姐姐"); vod.setVodPlayFrom("玩偶姐姐");
vod.setVodPlayUrl("播放$" + playUrl); vod.setVodPlayUrl("播放$" + url + ids.get(0));
return Result.string(vod); return Result.string(vod);
} }
@Override @Override
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception { public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
return Result.get().url(id).string(); return Result.get().url(id).parse().string();
} }
} }

Binary file not shown.

View File

@ -1 +1 @@
da248d3decd2fb6776b2ce39013c3e6e a04665ee58c5c24676bd43b11a01e918