Skip to content

Commit

Permalink
Merge pull request #18 from lushunming/mine
Browse files Browse the repository at this point in the history
qileso kuakes 电影云集 cloud bug修复
  • Loading branch information
Greatwallcorner authored Dec 17, 2024
2 parents d05f3f0 + e9bc966 commit 4eaca7a
Show file tree
Hide file tree
Showing 12 changed files with 656 additions and 31 deletions.
Binary file modified jar/spider.jar
Binary file not shown.
37 changes: 36 additions & 1 deletion json/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"spider": "../jar/spider.jar;md5;f1cd7c85ee11afa1bed29e0102fe7ac5",
"spider": "../jar/spider.jar;md5;8ebc68f78911a0f4e565b84df4bd2e80",
"sites": [
{
"key": "Douban",
Expand All @@ -10,6 +10,33 @@
"changeable": 0,
"ext": {}
},
{
"key": "KuaKeBa",
"name": "夸克吧",
"type": 3,
"api": "csp_KuaKeBa",
"searchable": 1,
"changeable": 1,
"ext": {}
},
{
"key": "DianYingYunJi",
"name": "电影云集",
"type": 3,
"api": "csp_DianYingYunJi",
"searchable": 1,
"changeable": 1,
"ext": {}
},
{
"key": "KuaKeS",
"name": "夸克网盘社",
"type": 3,
"api": "csp_KuaKeS",
"searchable": 1,
"changeable": 1,
"ext": {}
},
{
"key": "BD",
"name": "BD|首页",
Expand Down Expand Up @@ -236,6 +263,14 @@
"ext": "http://127.0.0.1:9978/file/tvfan/token.txt+4k|auto|fhd",
"timeout": 30
},
{
"key": "QiLeSo",
"name": "奇乐搜┃搜索",
"type": 3,
"api": "csp_QiLeSo",
"searchable": 1,
"timeout": 30
},
{
"key": "找資源",
"name": "找資源",
Expand Down
37 changes: 36 additions & 1 deletion json/configAll.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"spider": "../jar/spider.jar;md5;f1cd7c85ee11afa1bed29e0102fe7ac5",
"spider": "../jar/spider.jar;md5;8ebc68f78911a0f4e565b84df4bd2e80",
"sites": [
{
"key": "Douban",
Expand All @@ -10,6 +10,33 @@
"changeable": 0,
"ext": {}
},
{
"key": "KuaKeBa",
"name": "夸克吧",
"type": 3,
"api": "csp_KuaKeBa",
"searchable": 1,
"changeable": 1,
"ext": {}
},
{
"key": "DianYingYunJi",
"name": "电影云集",
"type": 3,
"api": "csp_DianYingYunJi",
"searchable": 1,
"changeable": 1,
"ext": {}
},
{
"key": "KuaKeS",
"name": "夸克网盘社",
"type": 3,
"api": "csp_KuaKeS",
"searchable": 1,
"changeable": 1,
"ext": {}
},
{
"key": "Liangzi",
"name": "量子影视",
Expand Down Expand Up @@ -116,6 +143,14 @@
"ext": "http://127.0.0.1:9978/file/tvfan/token.txt+4k|auto|fhd",
"timeout": 30
},
{
"key": "QiLeSo",
"name": "奇乐搜┃搜索",
"type": 3,
"api": "csp_QiLeSo",
"searchable": 1,
"timeout": 30
},
{
"key": "找資源",
"name": "找資源",
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/com/github/catvod/api/QuarkApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,19 @@ public Vod getVod(ShareData shareData) throws Exception {
List<Map<String, Object>> listData = listFile(1, shareData, files, subs, shareData.getShareId(), shareData.getFolderId(), 1);

List<String> playFrom = QuarkApi.get().getPlayFormatList();
List<String> playFromtmp = new ArrayList<>();
playFromtmp.add("quark原画");
for (String s : playFrom) {
playFromtmp.add("quark" + s);
}

List<String> playUrl = new ArrayList<>();

if (files.isEmpty()) {
return null;
}
for (int i = 0; i < files.get(files.size() - 1).getShareIndex(); i++) {
for (int index = 0; index < playFrom.size(); index++) {
for (int index = 0; index < playFromtmp.size(); index++) {
List<String> vodItems = new ArrayList<>();
for (Item video_item : files) {
if (video_item.getShareIndex() == i + 1) {
Expand All @@ -180,7 +185,7 @@ public Vod getVod(ShareData shareData) throws Exception {
vod.setVodPic("");
vod.setVodName("");
vod.setVodPlayUrl(StringUtils.join(playUrl, "$$$"));
vod.setVodPlayFrom(StringUtils.join(playFrom, "$$$"));
vod.setVodPlayFrom(StringUtils.join(playFromtmp, "$$$"));
vod.setTypeName("夸克云盘");
return vod;
}
Expand Down
11 changes: 7 additions & 4 deletions src/main/java/com/github/catvod/api/UCApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,19 @@ public Vod getVod(ShareData shareData) throws Exception {
List<Map<String, Object>> listData = listFile(1, shareData, files, subs, shareData.getShareId(), shareData.getFolderId(), 1);

List<String> playFrom = UCApi.get().getPlayFormatList();
playFrom = new ArrayList<>(playFrom);
playFrom.add("原画");
List<String> playFromtmp = new ArrayList<>();
playFromtmp.add("uc原画");
for (String s : playFrom) {
playFromtmp.add("uc" + s);
}

List<String> playUrl = new ArrayList<>();

if (files.isEmpty()) {
return null;
}
for (int i = 0; i < files.get(files.size() - 1).getShareIndex(); i++) {
for (int index = 0; index < playFrom.size(); index++) {
for (int index = 0; index < playFromtmp.size(); index++) {
List<String> vodItems = new ArrayList<>();
for (Item video_item : files) {
if (video_item.getShareIndex() == i + 1) {
Expand All @@ -199,7 +202,7 @@ public Vod getVod(ShareData shareData) throws Exception {
vod.setVodPic("");
vod.setVodName("");
vod.setVodPlayUrl(StringUtils.join(playUrl, "$$$"));
vod.setVodPlayFrom(StringUtils.join(playFrom, "$$$"));
vod.setVodPlayFrom(StringUtils.join(playFromtmp, "$$$"));
vod.setTypeName("uc云盘");
return vod;
}
Expand Down
38 changes: 15 additions & 23 deletions src/main/java/com/github/catvod/spider/Cloud.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import java.util.ArrayList;
import java.util.List;

import static com.github.catvod.spider.Quark.patternQuark;
import static com.github.catvod.spider.UC.patternUC;

/**
* @author ColaMint & Adam & FongMi
*/
Expand All @@ -34,9 +37,9 @@ public void init(String extend) throws Exception {
public String detailContent(List<String> shareUrl) throws Exception {
if (shareUrl.get(0).matches(Ali.pattern.pattern())) {
return ali.detailContent(shareUrl);
} else if (shareUrl.get(0).matches(Quark.patternQuark)) {
} else if (shareUrl.get(0).matches(patternQuark)) {
return quark.detailContent(shareUrl);
} else if (shareUrl.get(0).matches(UC.patternUC)) {
} else if (shareUrl.get(0).matches(patternUC)) {
return uc.detailContent(shareUrl);
}
return null;
Expand All @@ -55,28 +58,17 @@ public String playerContent(String flag, String id, List<String> vipFlags) throw

protected String detailContentVodPlayFrom(List<String> shareLinks) {
List<String> from = new ArrayList<>();
List<String> aliShare = new ArrayList<>();
List<String> quarkShare = new ArrayList<>();
List<String> ucShare = new ArrayList<>();

for (String shareLink : shareLinks) {
if (shareLink.matches(Ali.pattern.pattern())) {
aliShare.add(shareLink);
} else if (shareLink.matches(Quark.patternQuark)) {
quarkShare.add(shareLink);
} else if (shareLink.matches(UC.patternUC)) {
ucShare.add(shareLink);
if (shareLink.matches(patternUC)) {
from.add(uc.detailContentVodPlayFrom(ImmutableList.of(shareLink)));
} else if (shareLink.matches(patternQuark)) {
from.add(quark.detailContentVodPlayFrom(ImmutableList.of(shareLink)));
} else if (shareLink.matches(Ali.pattern.pattern())) {
from.add(ali.detailContentVodPlayFrom(ImmutableList.of(shareLink)));
}
}
if (!ucShare.isEmpty()) {
from.add(uc.detailContentVodPlayFrom(ucShare));
}
if (!quarkShare.isEmpty()) {
from.add(quark.detailContentVodPlayFrom(quarkShare));
}
if (!aliShare.isEmpty()) {
from.add(ali.detailContentVodPlayFrom(aliShare));
}



return StringUtils.join(from, "$$$");
}
Expand All @@ -86,9 +78,9 @@ protected String detailContentVodPlayUrl(List<String> shareLinks) throws Excepti
for (String shareLink : shareLinks) {
if (shareLink.matches(Ali.pattern.pattern())) {
urls.add(ali.detailContentVodPlayUrl(ImmutableList.of(shareLink)));
} else if (shareLink.matches(Quark.patternQuark)) {
} else if (shareLink.matches(patternQuark)) {
urls.add(quark.detailContentVodPlayUrl(ImmutableList.of(shareLink)));
} else if (shareLink.matches(UC.patternUC)) {
} else if (shareLink.matches(patternUC)) {
urls.add(uc.detailContentVodPlayUrl(ImmutableList.of(shareLink)));
}
}
Expand Down
153 changes: 153 additions & 0 deletions src/main/java/com/github/catvod/spider/DianYingYunJi.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
package com.github.catvod.spider;


import com.github.catvod.bean.Class;
import com.github.catvod.bean.Result;
import com.github.catvod.bean.Vod;
import com.github.catvod.net.OkHttp;
import com.github.catvod.utils.Utils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static com.github.catvod.spider.Quark.patternQuark;

/**
* 电影云集
*
* @author lushunming
* @createdate 2024-12-03
*/
public class DianYingYunJi extends Cloud {

private final String siteUrl = "https://dyyjpro.com";


private Map<String, String> getHeader() {
Map<String, String> header = new HashMap<>();
header.put("User-Agent", Utils.CHROME);
return header;
}

private Map<String, String> getHeaderWithCookie() {
Map<String, String> header = new HashMap<>();
header.put("User-Agent", Utils.CHROME);
header.put("cookie", "esc_search_captcha=1; result=43");
return header;
}

@Override
public void init(String extend) throws Exception {

super.init(extend);
}

@Override
public String homeContent(boolean filter) {
List<Class> classes = new ArrayList<>();
Document doc = Jsoup.parse(OkHttp.string(siteUrl, getHeader()));
Elements elements = doc.select(" #header-navbar > li.menu-item > a");
for (Element e : elements) {
String url = e.attr("href");
String name = e.text();
if (url.contains(siteUrl)) {
classes.add(new Class(url, name));
}

}

return Result.string(classes, parseVodListFromDoc(doc));
}

private List<Vod> parseVodListFromDoc(Document doc) {
List<Vod> list = new ArrayList<>();
Elements elements = doc.select(" article.post-item");
for (Element e : elements) {
String vodId = e.selectFirst("h2.entry-title > a").attr("href");
String vodPic = e.selectFirst(" div.entry-media > a").attr("data-bg");
if (!vodPic.startsWith("http")) {
vodPic = siteUrl + vodPic;
}
String vodName = e.selectFirst("h2.entry-title > a").text();
String vodRemarks = "";
list.add(new Vod(vodId, vodName, vodPic, vodRemarks));
}
return list;
}

@Override
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) {

Document doc = Jsoup.parse(OkHttp.string(String.format("%s/page/%s", tid, pg), getHeader()));
List<Vod> list = parseVodListFromDoc(doc);
int total = (Integer.parseInt(pg) + 1) * 19;
return Result.get().vod(list).page(Integer.parseInt(pg), Integer.parseInt(pg) + 1, 19, total).string();
}


@Override
public String detailContent(List<String> ids) throws Exception {
String vodId = ids.get(0);
Document doc = Jsoup.parse(OkHttp.string(vodId, getHeader()));

Vod item = new Vod();
item.setVodId(vodId);
item.setVodName(doc.selectFirst(" h1.post-title").text());
item.setVodPic(doc.selectFirst("article.post-content img").attr("src"));
String html = doc.select("article.post-content > p").text();
item.setVodDirector(getStrByRegex(Pattern.compile("导演:(.*?)编剧:"), html));
item.setVodArea(getStrByRegex(Pattern.compile("地区:(.*?)语言:"), html));
item.setVodActor(getStrByRegex(Pattern.compile("主演:(.*?)类型:"), html));
item.setVodYear(getStrByRegex(Pattern.compile("上映日期:(.*?)片长:"), html));
item.setVodRemarks("");
item.setVodContent(getStrByRegex(Pattern.compile("剧情简介(.*?)获奖情况"), html));

List<String> shareLinks = new ArrayList<>();

for (Element element : doc.select("article.post-content p a")) {
if (element.attr("href").matches(patternQuark)) {
shareLinks.add(element.attr("href").trim());
}
}

item.setTypeName(doc.selectFirst(" span.meta-cat-dot").text());

item.setVodPlayUrl(super.detailContentVodPlayUrl(shareLinks));
item.setVodPlayFrom(super.detailContentVodPlayFrom(shareLinks));

return Result.string(item);
}

private String getStrByRegex(Pattern pattern, String str) {
Matcher matcher = pattern.matcher(str);
if (matcher.find()) return matcher.group(1).trim();
return "";
}

@Override
public String searchContent(String key, boolean quick) throws Exception {
return searchContent(key, "1");
}

@Override
public String searchContent(String key, boolean quick, String pg) throws Exception {
return searchContent(key, pg);
}

private String searchContent(String key, String pg) {
String searchURL = siteUrl + String.format("?cat=&s=%s", URLEncoder.encode(key));
String html = OkHttp.string(searchURL, getHeaderWithCookie());
Document doc = Jsoup.parse(html);

return Result.string(parseVodListFromDoc(doc));
}
}
Loading

0 comments on commit 4eaca7a

Please sign in to comment.