forked from CatVodTVOfficial/CatVodTVSpider
-
Notifications
You must be signed in to change notification settings - Fork 15
/
PushAgent.java
98 lines (91 loc) · 3.78 KB
/
PushAgent.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package com.github.catvod.spider;
import com.github.catvod.crawler.Spider;
import com.github.catvod.utils.Misc;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.List;
/**
* Author: @SDL
*/
public class PushAgent extends Spider {
@Override
public String detailContent(List<String> ids) {
try {
String url = ids.get(0);
if (Misc.isVip(url)) {
JSONObject result = new JSONObject();
JSONArray list = new JSONArray();
JSONObject vodAtom = new JSONObject();
vodAtom.put("vod_id", url);
vodAtom.put("vod_name", url);
vodAtom.put("vod_pic", "https://pic.rmb.bdstatic.com/bjh/1d0b02d0f57f0a42201f92caba5107ed.jpeg");
vodAtom.put("type_name", "官源");
vodAtom.put("vod_year", "");
vodAtom.put("vod_area", "");
vodAtom.put("vod_remarks", "");
vodAtom.put("vod_actor", "");
vodAtom.put("vod_director", "");
vodAtom.put("vod_content", "");
vodAtom.put("vod_play_from", "jx");
vodAtom.put("vod_play_url", "立即播放$" + url);
list.put(vodAtom);
result.put("list", list);
return result.toString();
} else if (Misc.isVideoFormat(url)) {
JSONObject result = new JSONObject();
JSONArray list = new JSONArray();
JSONObject vodAtom = new JSONObject();
vodAtom.put("vod_id", url);
vodAtom.put("vod_name", url);
vodAtom.put("vod_pic", "https://pic.rmb.bdstatic.com/bjh/1d0b02d0f57f0a42201f92caba5107ed.jpeg");
vodAtom.put("type_name", "直连");
vodAtom.put("vod_play_from", "player");
vodAtom.put("vod_play_url", "立即播放$" + url);
list.put(vodAtom);
result.put("list", list);
return result.toString();
} else if (url.startsWith("http://") || url.startsWith("https://")) {
JSONObject result = new JSONObject();
JSONArray list = new JSONArray();
JSONObject vodAtom = new JSONObject();
vodAtom.put("vod_id", url);
vodAtom.put("vod_name", url);
vodAtom.put("vod_pic", "https://pic.rmb.bdstatic.com/bjh/1d0b02d0f57f0a42201f92caba5107ed.jpeg");
vodAtom.put("type_name", "网页");
vodAtom.put("vod_play_from", "parse");
vodAtom.put("vod_play_url", "立即播放$" + url);
list.put(vodAtom);
result.put("list", list);
return result.toString();
}
} catch (Throwable throwable) {
}
return "";
}
@Override
public String playerContent(String flag, String id, List<String> vipFlags) {
try {
if (flag.equals("jx")) {
JSONObject result = new JSONObject();
result.put("parse", 1);
result.put("jx", "1");
result.put("url", id);
return result.toString();
} else if (flag.equals("parse")) {
JSONObject result = new JSONObject();
result.put("parse", 1);
result.put("playUrl", "");
result.put("url", id);
return result.toString();
} else if (flag.equals("player")) {
JSONObject result = new JSONObject();
result.put("parse", 0);
result.put("playUrl", "");
result.put("url", id);
return result.toString();
}
} catch (Throwable throwable) {
}
return "";
}
}