Fix push bug
This commit is contained in:
parent
e456d1fba4
commit
c3c89da41a
|
|
@ -1,5 +1,6 @@
|
||||||
package com.github.catvod.bean;
|
package com.github.catvod.bean;
|
||||||
|
|
||||||
|
import com.github.catvod.utils.Util;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
@ -10,6 +11,7 @@ import org.json.JSONObject;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -135,6 +137,13 @@ public class Result {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Result chrome() {
|
||||||
|
Map<String, String> header = new HashMap<>();
|
||||||
|
header.put("User-Agent", Util.CHROME);
|
||||||
|
header(header);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Result parse() {
|
public Result parse() {
|
||||||
this.parse = 1;
|
this.parse = 1;
|
||||||
return this;
|
return this;
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,9 @@ public class Push extends Spider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String playerContent(String flag, String id, List<String> vipFlags) {
|
public String playerContent(String flag, String id, List<String> vipFlags) {
|
||||||
|
if (id.startsWith("http") && id.contains("***")) id = id.replace("***", "#");
|
||||||
if (flag.equals("直連")) return Result.get().url(id).subs(getSubs(id)).string();
|
if (flag.equals("直連")) return Result.get().url(id).subs(getSubs(id)).string();
|
||||||
if (flag.equals("嗅探")) return Result.get().parse().url(id).string();
|
if (flag.equals("嗅探")) return Result.get().parse().url(id).chrome().string();
|
||||||
if (flag.equals("解析")) return Result.get().parse().jx().url(id).string();
|
if (flag.equals("解析")) return Result.get().parse().jx().url(id).string();
|
||||||
return ali.playerContent(flag, id, vipFlags);
|
return ali.playerContent(flag, id, vipFlags);
|
||||||
}
|
}
|
||||||
|
|
@ -48,6 +49,7 @@ public class Push extends Spider {
|
||||||
vod.setVodId(url);
|
vod.setVodId(url);
|
||||||
vod.setTypeName("FongMi");
|
vod.setTypeName("FongMi");
|
||||||
vod.setVodName(url.startsWith("file://") ? new File(url).getName() : url);
|
vod.setVodName(url.startsWith("file://") ? new File(url).getName() : url);
|
||||||
|
if (url.startsWith("http") && url.contains("#")) url = url.replace("#", "***");
|
||||||
vod.setVodPic("https://pic.rmb.bdstatic.com/bjh/1d0b02d0f57f0a42201f92caba5107ed.jpeg");
|
vod.setVodPic("https://pic.rmb.bdstatic.com/bjh/1d0b02d0f57f0a42201f92caba5107ed.jpeg");
|
||||||
vod.setVodPlayFrom(TextUtils.join("$$$", Arrays.asList("直連", "嗅探", "解析")));
|
vod.setVodPlayFrom(TextUtils.join("$$$", Arrays.asList("直連", "嗅探", "解析")));
|
||||||
vod.setVodPlayUrl(TextUtils.join("$$$", Arrays.asList("播放$" + url, "播放$" + url, "播放$" + url)));
|
vod.setVodPlayUrl(TextUtils.join("$$$", Arrays.asList("播放$" + url, "播放$" + url, "播放$" + url)));
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
db8ee47ff1095679871f083b2f5bf388
|
96a99e445d620353890869d95755b890
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue