1.完善玩偶哥哥视频详情信息展示
2.添加站点阿里云盘多分享链接支持 3.玩偶哥哥已添加多分享链接支持 Signed-off-by: Oiltea <oiltea@qq.com>
This commit is contained in:
parent
afdd012f8d
commit
98e6a68c5c
|
|
@ -283,7 +283,7 @@ public class API {
|
||||||
List<String> playFrom = Arrays.asList("原畫", "普畫");
|
List<String> playFrom = Arrays.asList("原畫", "普畫");
|
||||||
List<String> episode = new ArrayList<>();
|
List<String> episode = new ArrayList<>();
|
||||||
List<String> playUrl = new ArrayList<>();
|
List<String> playUrl = new ArrayList<>();
|
||||||
for (Item file : files) episode.add(file.getDisplayName() + "$" + file.getFileId() + findSubs(file.getName(), subs));
|
for (Item file : files) episode.add(file.getDisplayName() + "$" + API.get().shareId + "@" + file.getFileId() + findSubs(file.getName(), subs));
|
||||||
for (int i = 0; i < playFrom.size(); i++) playUrl.add(TextUtils.join("#", episode));
|
for (int i = 0; i < playFrom.size(); i++) playUrl.add(TextUtils.join("#", episode));
|
||||||
Vod vod = new Vod();
|
Vod vod = new Vod();
|
||||||
vod.setVodId(url);
|
vod.setVodId(url);
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,10 @@ public class Vod {
|
||||||
this.vodPlayUrl = vodPlayUrl;
|
this.vodPlayUrl = vodPlayUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getVodPlayUrl() {
|
||||||
|
return vodPlayUrl;
|
||||||
|
}
|
||||||
|
|
||||||
public void setVodTag(String vodTag) {
|
public void setVodTag(String vodTag) {
|
||||||
this.vodTag = vodTag;
|
this.vodTag = vodTag;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
package com.github.catvod.spider;
|
package com.github.catvod.spider;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
import com.github.catvod.ali.API;
|
import com.github.catvod.ali.API;
|
||||||
import com.github.catvod.bean.Result;
|
import com.github.catvod.bean.Result;
|
||||||
import com.github.catvod.crawler.Spider;
|
import com.github.catvod.crawler.Spider;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
|
@ -36,13 +35,52 @@ public class Ali extends Spider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String playerContent(String flag, String id, List<String> vipFlags) {
|
public String playerContent(String flag, String id, List<String> vipFlags) {
|
||||||
return API.get().playerContent(id.split("\\+"), flag.equals("原畫"));
|
API.get().setShareId(id.split("@")[0]);
|
||||||
|
return API.get().playerContent(id.split("@")[1].split("\\+"), flag.split("#")[0].equals("原畫"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取详情内容视频播放地址(多 share_link 模式)
|
||||||
|
*
|
||||||
|
* @param ids share_link 集合
|
||||||
|
* @return 详情内容视频播放地址
|
||||||
|
*/
|
||||||
|
public String detailContentVodPlayUrl(List<String> ids) throws Exception {
|
||||||
|
List<String> playUrl = new ArrayList<>();
|
||||||
|
for (String id : ids) {
|
||||||
|
Matcher matcher = pattern.matcher(id);
|
||||||
|
if (matcher.find()) {
|
||||||
|
String shareId = matcher.group(1);
|
||||||
|
String fileId = matcher.groupCount() == 3 ? matcher.group(3) : "";
|
||||||
|
API.get().setShareId(shareId);
|
||||||
|
playUrl.add(API.get().getVod(id, fileId).getVodPlayUrl());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TextUtils.join("$$$", playUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取详情内容视频播放来源(多 shared_link 模式)
|
||||||
|
*
|
||||||
|
* @param ids share_link 集合
|
||||||
|
* @return 详情内容视频播放来源
|
||||||
|
*/
|
||||||
|
public String detailContentVodPlayFrom(List<String> ids) {
|
||||||
|
List<String> playFrom = new ArrayList<>();
|
||||||
|
if (ids.size() > 1) {
|
||||||
|
for (int i = 1; i <= ids.size(); i++) {
|
||||||
|
playFrom.addAll(Arrays.asList(String.format(Locale.CHINA, "原畫#%02d", i), String.format(Locale.CHINA, "普畫#%02d", i)));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
playFrom.addAll(Arrays.asList("原畫", "普畫"));
|
||||||
|
}
|
||||||
|
return TextUtils.join("$$$", playFrom);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Object[] proxy(Map<String, String> params) throws Exception {
|
public static Object[] proxy(Map<String, String> params) throws Exception {
|
||||||
String type = params.get("type");
|
String type = params.get("type");
|
||||||
if (type.equals("sub")) return API.get().proxySub(params);
|
if ("sub".equals(type)) return API.get().proxySub(params);
|
||||||
if (type.equals("token")) return API.get().getToken();
|
if ("token".equals(type)) return API.get().getToken();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -15,7 +15,10 @@ import org.jsoup.nodes.Element;
|
||||||
import org.jsoup.select.Elements;
|
import org.jsoup.select.Elements;
|
||||||
|
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.*;
|
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.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
|
@ -27,7 +30,6 @@ public class Wogg extends Ali {
|
||||||
private final String siteURL = "http://tvfan.xxooo.cf";
|
private final String siteURL = "http://tvfan.xxooo.cf";
|
||||||
|
|
||||||
private JSONObject filters;
|
private JSONObject filters;
|
||||||
private final Pattern regexAli = Pattern.compile("(https://www.aliyundrive.com/s/[^\"]+)");
|
|
||||||
private final Pattern regexCategory = Pattern.compile("/vodtype/(\\w+).html");
|
private final Pattern regexCategory = Pattern.compile("/vodtype/(\\w+).html");
|
||||||
private final Pattern regexPageTotal = Pattern.compile("\\$\\(\"\\.mac_total\"\\)\\.text\\('(\\d+)'\\);");
|
private final Pattern regexPageTotal = Pattern.compile("\\$\\(\"\\.mac_total\"\\)\\.text\\('(\\d+)'\\);");
|
||||||
|
|
||||||
|
|
@ -72,7 +74,7 @@ public class Wogg extends Ali {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Document doc = Jsoup.parse(OkHttp.string(siteURL + String.format("/index.php/vodshow/%s.html", String.join("-", urlParams)), getHeader()));
|
Document doc = Jsoup.parse(OkHttp.string(String.format("%s/index.php/vodshow/%s.html", siteURL, String.join("-", urlParams)), getHeader()));
|
||||||
int page = Integer.parseInt(pg), limit = 72, total = 0;
|
int page = Integer.parseInt(pg), limit = 72, total = 0;
|
||||||
Matcher matcher = regexPageTotal.matcher(doc.html());
|
Matcher matcher = regexPageTotal.matcher(doc.html());
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
|
|
@ -97,9 +99,37 @@ public class Wogg extends Ali {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String detailContent(List<String> ids) throws Exception {
|
public String detailContent(List<String> ids) throws Exception {
|
||||||
Matcher matcher = regexAli.matcher(OkHttp.string(siteURL + ids.get(0), getHeader()));
|
String vodId = ids.get(0);
|
||||||
if (matcher.find()) return super.detailContent(Collections.singletonList(matcher.group(1)));
|
|
||||||
return "";
|
Document doc = Jsoup.parse(OkHttp.string(siteURL + vodId, getHeader()));
|
||||||
|
|
||||||
|
Vod item = new Vod();
|
||||||
|
item.setVodId(vodId);
|
||||||
|
item.setVodName(doc.selectFirst(".video-info-header > .page-title").text());
|
||||||
|
item.setVodPic(doc.selectFirst(".module-item-pic img").attr("data-src"));
|
||||||
|
item.setVodArea(doc.select(".video-info-header a.tag-link").last().text());
|
||||||
|
item.setTypeName(String.join(",", doc.select(".video-info-header div.tag-link a").eachText()));
|
||||||
|
|
||||||
|
List<String> shareLinks = doc.select(".module-row-text").eachAttr("data-clipboard-text");
|
||||||
|
item.setVodPlayUrl(super.detailContentVodPlayUrl(shareLinks));
|
||||||
|
item.setVodPlayFrom(super.detailContentVodPlayFrom(shareLinks));
|
||||||
|
|
||||||
|
Elements elements = doc.select(".video-info-item");
|
||||||
|
for (Element e : elements) {
|
||||||
|
String title = e.previousElementSibling().text();
|
||||||
|
if (title.contains("导演")) {
|
||||||
|
item.setVodDirector(String.join(",", e.select("a").eachText()));
|
||||||
|
} else if (title.contains("主演")) {
|
||||||
|
item.setVodActor(String.join(",", e.select("a").eachText()));
|
||||||
|
} else if (title.contains("年代")) {
|
||||||
|
item.setVodYear(e.selectFirst("a").text().trim());
|
||||||
|
} else if (title.contains("备注")) {
|
||||||
|
item.setVodRemarks(e.text().trim());
|
||||||
|
} else if (title.contains("剧情")) {
|
||||||
|
item.setVodContent(e.selectFirst(".sqjj_a").text().replace("[收起部分]", "").trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result.string(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue