Merge branch 'pr/28'
This commit is contained in:
commit
30db354e69
|
|
@ -288,7 +288,7 @@ public class AliYun {
|
||||||
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);
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,11 @@ public class Vod {
|
||||||
public void setVodPlayUrl(String vodPlayUrl) {
|
public void setVodPlayUrl(String vodPlayUrl) {
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,11 @@ package com.github.catvod.spider;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import com.github.catvod.api.AliYun;
|
import com.github.catvod.api.AliYun;
|
||||||
|
import android.text.TextUtils;
|
||||||
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 +36,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 AliYun.get().playerContent(id.split("\\+"), flag.equals("原畫"));
|
API.get().setShareId(id.split("@")[0]);
|
||||||
|
return AliYun.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 AliYun.get().proxySub(params);
|
if ("sub".equals(type)) return AliYun.get().proxySub(params);
|
||||||
if (type.equals("token")) return AliYun.get().getToken();
|
if ("token".equals(type)) return AliYun.get().getToken();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue