云盘多链接问题修复
This commit is contained in:
parent
56eb23e442
commit
4ce5d1313b
|
|
@ -50,15 +50,16 @@ public class Ali extends Spider {
|
|||
* 獲取詳情內容視頻播放來源(多 shared_link)
|
||||
*
|
||||
* @param ids share_link 集合
|
||||
* @param i
|
||||
* @return 詳情內容視頻播放來源
|
||||
*/
|
||||
public String detailContentVodPlayFrom(List<String> ids) {
|
||||
public String detailContentVodPlayFrom(List<String> ids, int index) {
|
||||
List<String> playFrom = new ArrayList<>();
|
||||
if (ids.size() < 2) return TextUtils.join("$$$", Arrays.asList("轉存原畫", "分享原畫", "代理普畫"));
|
||||
// if (ids.size() < 2) return TextUtils.join("$$$", Arrays.asList("轉存原畫", "分享原畫", "代理普畫"));
|
||||
for (int i = 1; i <= ids.size(); i++) {
|
||||
playFrom.add(String.format(Locale.getDefault(), "轉存原畫#%02d", i));
|
||||
playFrom.add(String.format(Locale.getDefault(), "分享原畫#%02d", i));
|
||||
playFrom.add(String.format(Locale.getDefault(), "代理普畫#%02d", i));
|
||||
playFrom.add(String.format(Locale.getDefault(), "轉存原畫#%02d%02d", i,index));
|
||||
playFrom.add(String.format(Locale.getDefault(), "分享原畫#%02d%02d", i,index));
|
||||
playFrom.add(String.format(Locale.getDefault(), "代理普畫#%02d%02d", i,index));
|
||||
}
|
||||
return TextUtils.join("$$$", playFrom);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.github.catvod.spider;
|
|||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.github.catvod.crawler.Spider;
|
||||
import com.github.catvod.utils.Json;
|
||||
import com.github.catvod.utils.Util;
|
||||
|
|
@ -55,46 +54,32 @@ public class Cloud extends Spider {
|
|||
|
||||
protected String detailContentVodPlayFrom(List<String> shareLinks) {
|
||||
List<String> from = new ArrayList<>();
|
||||
List<String> ucFrom = new ArrayList<>();
|
||||
List<String> quarkFrom = new ArrayList<>();
|
||||
List<String> aliFrom = new ArrayList<>();
|
||||
|
||||
int i =0;
|
||||
for (String shareLink : shareLinks) {
|
||||
i++;
|
||||
if (shareLink.matches(Util.patternUC)) {
|
||||
ucFrom.add(shareLink);
|
||||
from.add(uc.detailContentVodPlayFrom(List.of(shareLink),i));
|
||||
} else if (shareLink.matches(Util.patternQuark)) {
|
||||
quarkFrom.add(shareLink);
|
||||
from.add(quark.detailContentVodPlayFrom(List.of(shareLink),i));
|
||||
} else if (shareLink.matches(Util.patternAli)) {
|
||||
aliFrom.add(shareLink);
|
||||
from.add(ali.detailContentVodPlayFrom(List.of(shareLink),i));
|
||||
}
|
||||
}
|
||||
|
||||
from.add(uc.detailContentVodPlayFrom(ucFrom));
|
||||
from.add(quark.detailContentVodPlayFrom(quarkFrom));
|
||||
from.add(ali.detailContentVodPlayFrom(aliFrom));
|
||||
|
||||
|
||||
return TextUtils.join("$$$", from);
|
||||
}
|
||||
|
||||
protected String detailContentVodPlayUrl(List<String> shareLinks) throws Exception {
|
||||
List<String> urls = new ArrayList<>();
|
||||
List<String> ucUrl = new ArrayList<>();
|
||||
List<String> quarkUrl = new ArrayList<>();
|
||||
List<String> aliUrl = new ArrayList<>();
|
||||
for (String shareLink : shareLinks) {
|
||||
if (shareLink.matches(Util.patternUC)) {
|
||||
ucUrl.add(shareLink);
|
||||
urls.add(uc.detailContentVodPlayUrl(List.of(shareLink)));
|
||||
} else if (shareLink.matches(Util.patternQuark)) {
|
||||
quarkUrl.add(shareLink);
|
||||
urls.add(quark.detailContentVodPlayUrl(List.of(shareLink)));
|
||||
} else if (shareLink.matches(Util.patternAli)) {
|
||||
aliUrl.add(shareLink);
|
||||
urls.add(ali.detailContentVodPlayUrl(List.of(shareLink)));
|
||||
}
|
||||
}
|
||||
urls.add(uc.detailContentVodPlayUrl(ucUrl));
|
||||
urls.add(quark.detailContentVodPlayUrl(quarkUrl));
|
||||
urls.add(ali.detailContentVodPlayUrl(aliUrl));
|
||||
|
||||
return TextUtils.join("$$$", urls);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,9 +42,10 @@ public class Quark extends Spider {
|
|||
* 獲取詳情內容視頻播放來源(多 shared_link)
|
||||
*
|
||||
* @param ids share_link 集合
|
||||
* @param i
|
||||
* @return 詳情內容視頻播放來源
|
||||
*/
|
||||
public String detailContentVodPlayFrom(List<String> ids) {
|
||||
public String detailContentVodPlayFrom(List<String> ids, int index) {
|
||||
List<String> playFrom = new ArrayList<>();
|
||||
/* if (ids.size() < 2){
|
||||
return TextUtils.join("$$$", QuarkApi.get().getPlayFormatList());
|
||||
|
|
@ -53,10 +54,10 @@ public class Quark extends Spider {
|
|||
for (int i = 1; i <= ids.size(); i++) {
|
||||
|
||||
for (String s : QuarkApi.get().getPlayFormatList()) {
|
||||
playFrom.add(String.format(Locale.getDefault(), "quark" + s + "#%02d", i));
|
||||
playFrom.add(String.format(Locale.getDefault(), "quark" + s + "#%02d%02d", i,index));
|
||||
|
||||
}
|
||||
playFrom.add("quark原画" + i);
|
||||
playFrom.add("quark原画" + i+index);
|
||||
}
|
||||
return TextUtils.join("$$$", playFrom);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.github.catvod.spider;
|
|||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.github.catvod.api.UCApi;
|
||||
import com.github.catvod.bean.Result;
|
||||
import com.github.catvod.bean.uc.ShareData;
|
||||
|
|
@ -44,9 +45,10 @@ public class UC extends Spider {
|
|||
* 獲取詳情內容視頻播放來源(多 shared_link)
|
||||
*
|
||||
* @param ids share_link 集合
|
||||
* @param i
|
||||
* @return 詳情內容視頻播放來源
|
||||
*/
|
||||
public String detailContentVodPlayFrom(List<String> ids) {
|
||||
public String detailContentVodPlayFrom(List<String> ids, int index) {
|
||||
List<String> playFrom = new ArrayList<>();
|
||||
/* if (ids.size() < 2){
|
||||
return TextUtils.join("$$$", UCApi.get().getPlayFormatList());
|
||||
|
|
@ -55,10 +57,10 @@ public class UC extends Spider {
|
|||
for (int i = 1; i <= ids.size(); i++) {
|
||||
|
||||
for (String s : UCApi.get().getPlayFormatList()) {
|
||||
playFrom.add(String.format(Locale.getDefault(), "uc" + s + "#%02d", i));
|
||||
playFrom.add(String.format(Locale.getDefault(), "uc" + s + "#%02d%02d", i, index));
|
||||
|
||||
}
|
||||
playFrom.add("uc原画"+i);
|
||||
playFrom.add("uc原画" + i + index);
|
||||
}
|
||||
return TextUtils.join("$$$", playFrom);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public class WoggTest {
|
|||
@org.junit.Test
|
||||
public void detailContent() throws Exception {
|
||||
|
||||
String content = spider.detailContent(Arrays.asList("/voddetail/88884.html"));
|
||||
String content = spider.detailContent(Arrays.asList("/voddetail/94312.html"));
|
||||
System.out.println("detailContent--" + content);
|
||||
|
||||
JsonObject map = Json.safeObject(content);
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
cdcfb3170b9643a4664d7641c1ca0df3
|
||||
300591fb185317efe162dd9f0e1241ae
|
||||
|
|
|
|||
Loading…
Reference in New Issue