mirror of
https://github.com/bizhangjie/CatVodSpider.git
synced 2026-11-04 18:52:12 +00:00
'更新可用状态'
This commit is contained in:
1 parent
05f5c807ea
commit
cd935ac14e
5 files changed
+342
-2
No files matched your search
@@ -12,6 +12,7 @@ import com.github.catvod.crawler.Spider;
|
||||
import com.github.catvod.spider.CaoLiu;
|
||||
import com.github.catvod.spider.Cg51;
|
||||
import com.github.catvod.spider.Douban;
|
||||
import com.github.catvod.spider.IQIYI;
|
||||
import com.github.catvod.spider.Ikanbot;
|
||||
import com.github.catvod.spider.Init;
|
||||
import com.github.catvod.spider.J91;
|
||||
@@ -62,7 +63,7 @@ public class MainActivity extends Activity {
|
||||
private void initSpider() {
|
||||
try {
|
||||
Init.init(getApplicationContext());
|
||||
spider = new Cg51();
|
||||
spider = new IQIYI();
|
||||
spider.init(this, "");
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -0,0 +1,331 @@
|
||||
package com.github.catvod.spider;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.github.catvod.crawler.Spider;
|
||||
import com.github.catvod.crawler.SpiderDebug;
|
||||
import com.github.catvod.net.OkHttp;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class IQIYI extends Spider {
|
||||
|
||||
protected JSONObject a;
|
||||
|
||||
protected JSONArray xr;
|
||||
|
||||
protected JSONObject q = new JSONObject();
|
||||
|
||||
protected HashMap<String, String> dn = new HashMap<>();
|
||||
|
||||
private String m2938q(String str, String str2) {
|
||||
String str3;
|
||||
try {
|
||||
if (str2.startsWith("//")) {
|
||||
Uri parse = Uri.parse(str);
|
||||
str3 = parse.getScheme() + ":" + str2;
|
||||
} else if (str2.contains("://")) {
|
||||
return str2;
|
||||
} else {
|
||||
Uri parse2 = Uri.parse(str);
|
||||
str3 = parse2.getScheme() + "://" + parse2.getHost() + str2;
|
||||
}
|
||||
return str3;
|
||||
} catch (Exception e) {
|
||||
SpiderDebug.log(e);
|
||||
return str2;
|
||||
}
|
||||
}
|
||||
|
||||
public String categoryContent(String str, String str2, boolean z, HashMap<String, String> hashMap) {
|
||||
IQIYI iqiyi = this;
|
||||
try {
|
||||
String str3 = "https://pcw-api.iqiyi.com/search/video/videolists?channel_id=" + str + "&is_purchase=&mode=24&pageNum=" + str2 + "&pageSize=24";
|
||||
if (hashMap != null) {
|
||||
Set<String> keySet = hashMap.keySet();
|
||||
ArrayList arrayList = new ArrayList();
|
||||
for (String str4 : keySet) {
|
||||
String trim = hashMap.get(str4).trim();
|
||||
if (str4.matches("\\d+")) {
|
||||
arrayList.add(trim + ";must");
|
||||
} else {
|
||||
str3 = str3 + "&" + str4 + "=" + trim;
|
||||
}
|
||||
}
|
||||
str3 = str3 + "&three_category_id=" + iqiyi.join(",", arrayList);
|
||||
}
|
||||
String m2007h = OkHttp.string(str3, iqiyi.dn(str3));
|
||||
JSONObject jSONObject = new JSONObject();
|
||||
try {
|
||||
JSONArray optJSONArray = new JSONObject(m2007h).optJSONObject("data").optJSONArray("list");
|
||||
JSONArray jSONArray = new JSONArray();
|
||||
int i = 0;
|
||||
while (i < optJSONArray.length()) {
|
||||
JSONObject optJSONObject = optJSONArray.optJSONObject(i);
|
||||
String optString = optJSONObject.optString("name");
|
||||
String m2938q = iqiyi.m2938q(str3, optJSONObject.optString("imageUrl"));
|
||||
String optString2 = optJSONObject.optString("score");
|
||||
String optString3 = optJSONObject.optString("playUrl");
|
||||
JSONArray jSONArray2 = optJSONArray;
|
||||
String str5 = str3;
|
||||
if (!optJSONObject.optString("albumId").equals("")) {
|
||||
optString3 = optJSONObject.optInt("sourceId") != 0 ? "/video/video/baseinfo/" + optJSONObject.optString("tvId") + "?userInfo=verify&jsonpCbName=videoInfo39" : "/albums/album/avlistinfo?aid=" + optJSONObject.optString("albumId") + "&size=5000&page=1&url=" + optString3;
|
||||
} else if (optJSONObject.optLong("tvId") != 0) {
|
||||
optString3 = "/video/video/baseinfo/" + optJSONObject.optString("tvId") + "?userInfo=verify&jsonpCbName=videoInfo39";
|
||||
}
|
||||
JSONObject jSONObject2 = new JSONObject();
|
||||
jSONObject2.put("vod_id", optString3);
|
||||
jSONObject2.put("vod_name", optString);
|
||||
jSONObject2.put("vod_pic", m2938q);
|
||||
jSONObject2.put("vod_remarks", optString2);
|
||||
jSONArray.put(jSONObject2);
|
||||
i++;
|
||||
iqiyi = this;
|
||||
optJSONArray = jSONArray2;
|
||||
str3 = str5;
|
||||
}
|
||||
jSONObject.put("page", str2);
|
||||
jSONObject.put("pagecount", Integer.MAX_VALUE);
|
||||
jSONObject.put("limit", 90);
|
||||
jSONObject.put("total", Integer.MAX_VALUE);
|
||||
jSONObject.put("list", jSONArray);
|
||||
} catch (Exception e) {
|
||||
SpiderDebug.log(e);
|
||||
}
|
||||
return jSONObject.toString(4);
|
||||
} catch (Exception e2) {
|
||||
SpiderDebug.log(e2);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String detailContent(List<String> list) {
|
||||
try {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("https://pcw-api.iqiyi.com");
|
||||
sb.append(list.get(0));
|
||||
String sb2 = sb.toString();
|
||||
JSONObject jSONObject = new JSONObject(OkHttp.string(sb2, dn(sb2))).getJSONObject("data");
|
||||
JSONObject jSONObject2 = new JSONObject();
|
||||
JSONObject optJSONObject = jSONObject.optJSONArray("epsodelist") != null ? jSONObject.optJSONArray("epsodelist").optJSONObject(0) : jSONObject;
|
||||
jSONObject2.put("vod_id", list.get(0));
|
||||
jSONObject2.put("vod_name", optJSONObject.optString("name").replaceAll("第\\d+(?:集|期)", ""));
|
||||
jSONObject2.put("vod_pic", m2938q(sb2, optJSONObject.optString("imageUrl")));
|
||||
JSONObject optJSONObject2 = optJSONObject.optJSONObject("people");
|
||||
JSONArray optJSONArray = optJSONObject2.optJSONArray("main_charactor");
|
||||
if (optJSONArray == null) {
|
||||
optJSONArray = optJSONObject2.optJSONArray("producer");
|
||||
}
|
||||
if (optJSONArray == null) {
|
||||
optJSONArray = optJSONObject2.optJSONArray("guest");
|
||||
}
|
||||
if (optJSONArray == null) {
|
||||
optJSONArray = optJSONObject2.optJSONArray("singer");
|
||||
}
|
||||
ArrayList arrayList = new ArrayList();
|
||||
if (optJSONArray != null) {
|
||||
for (int i = 0; i < optJSONArray.length(); i++) {
|
||||
arrayList.add(optJSONArray.optJSONObject(i).optString("name"));
|
||||
}
|
||||
}
|
||||
JSONArray optJSONArray2 = optJSONObject2.optJSONArray("director");
|
||||
if (optJSONArray2 == null) {
|
||||
optJSONArray2 = optJSONObject2.optJSONArray("screen_writer");
|
||||
}
|
||||
if (optJSONArray2 == null) {
|
||||
optJSONArray2 = optJSONObject2.optJSONArray("host");
|
||||
}
|
||||
ArrayList arrayList2 = new ArrayList();
|
||||
if (optJSONArray2 != null) {
|
||||
for (int i2 = 0; i2 < optJSONArray2.length(); i2++) {
|
||||
arrayList2.add(optJSONArray2.optJSONObject(i2).optString("name"));
|
||||
}
|
||||
}
|
||||
jSONObject2.put("vod_remarks", optJSONObject.optString("duration"));
|
||||
jSONObject2.put("vod_actor", join(",", arrayList));
|
||||
jSONObject2.put("vod_director", join(",", arrayList2));
|
||||
jSONObject2.put("vod_content", optJSONObject.optString("description"));
|
||||
JSONArray optJSONArray3 = jSONObject.optJSONArray("epsodelist");
|
||||
if (optJSONArray3 == null) {
|
||||
optJSONArray3 = new JSONArray();
|
||||
optJSONArray3.put(jSONObject);
|
||||
}
|
||||
ArrayList arrayList3 = new ArrayList();
|
||||
for (int i3 = 0; i3 < optJSONArray3.length(); i3++) {
|
||||
JSONObject optJSONObject3 = optJSONArray3.optJSONObject(i3);
|
||||
arrayList3.add(optJSONObject3.optString("order") + " " + optJSONObject3.optString("subtitle") + "$" + optJSONObject3.optString("playUrl"));
|
||||
}
|
||||
jSONObject2.put("vod_play_from", "iqiyi");
|
||||
jSONObject2.put("vod_play_url", join("#", arrayList3));
|
||||
JSONObject jSONObject3 = new JSONObject();
|
||||
JSONArray jSONArray = new JSONArray();
|
||||
jSONArray.put(jSONObject2);
|
||||
jSONObject3.put("list", jSONArray);
|
||||
return jSONObject3.toString(4);
|
||||
} catch (Exception e) {
|
||||
SpiderDebug.log(e);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
protected HashMap<String, String> dn(String str) {
|
||||
HashMap<String, String> hashMap = new HashMap<>();
|
||||
hashMap.put("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36");
|
||||
return hashMap;
|
||||
}
|
||||
|
||||
public String homeContent(boolean z) {
|
||||
IQIYI iqiyi = this;
|
||||
try {
|
||||
String str = "https://pcw-api.iqiyi.com/search/video/videolists?channel_id=2&is_purchase=&mode=24&pageNum=1&pageSize=24&data_type=1&site=iqiyi";
|
||||
String m2007h = OkHttp.string("https://pcw-api.iqiyi.com/search/video/videolists?channel_id=2&is_purchase=&mode=24&pageNum=1&pageSize=24&data_type=1&site=iqiyi", iqiyi.dn("https://pcw-api.iqiyi.com/search/video/videolists?channel_id=2&is_purchase=&mode=24&pageNum=1&pageSize=24&data_type=1&site=iqiyi"));
|
||||
JSONObject jSONObject = new JSONObject();
|
||||
jSONObject.put("class", iqiyi.xr);
|
||||
if (z) {
|
||||
jSONObject.put("filters", iqiyi.a);
|
||||
}
|
||||
try {
|
||||
JSONArray optJSONArray = new JSONObject(m2007h).optJSONObject("data").optJSONArray("list");
|
||||
JSONArray jSONArray = new JSONArray();
|
||||
int i = 0;
|
||||
while (i < optJSONArray.length()) {
|
||||
JSONObject optJSONObject = optJSONArray.optJSONObject(i);
|
||||
String optString = optJSONObject.optString("name");
|
||||
String m2938q = iqiyi.m2938q(str, optJSONObject.optString("imageUrl"));
|
||||
String optString2 = optJSONObject.optString("score");
|
||||
String optString3 = optJSONObject.optString("playUrl");
|
||||
String str2 = str;
|
||||
if (!optJSONObject.optString("albumId").equals("")) {
|
||||
if (optJSONObject.optInt("sourceId") != 0) {
|
||||
optString3 = "/video/video/baseinfo/" + optJSONObject.optString("tvId") + "?userInfo=verify&jsonpCbName=videoInfo39";
|
||||
} else {
|
||||
optString3 = "/albums/album/avlistinfo?aid=" + optJSONObject.optString("albumId") + "&size=5000&page=1&url=" + optString3;
|
||||
}
|
||||
} else if (optJSONObject.optLong("tvId") != 0) {
|
||||
optString3 = "/video/video/baseinfo/" + optJSONObject.optString("tvId") + "?userInfo=verify&jsonpCbName=videoInfo39";
|
||||
}
|
||||
JSONObject jSONObject2 = new JSONObject();
|
||||
jSONObject2.put("vod_id", optString3);
|
||||
jSONObject2.put("vod_name", optString);
|
||||
jSONObject2.put("vod_pic", m2938q);
|
||||
jSONObject2.put("vod_remarks", optString2);
|
||||
jSONArray.put(jSONObject2);
|
||||
i++;
|
||||
iqiyi = this;
|
||||
str = str2;
|
||||
}
|
||||
jSONObject.put("list", jSONArray);
|
||||
} catch (Exception e) {
|
||||
SpiderDebug.log(e);
|
||||
}
|
||||
return jSONObject.toString(4);
|
||||
} catch (Exception e2) {
|
||||
SpiderDebug.log(e2);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String homeVideoContent() {
|
||||
try {
|
||||
JSONArray jSONArray = new JSONObject(OkHttp.string("https://pcw-api.iqiyi.com/api.php/app/index_video?token=", dn("https://pcw-api.iqiyi.com/api.php/app/index_video?token="))).getJSONArray("list");
|
||||
JSONArray jSONArray2 = new JSONArray();
|
||||
for (int i = 0; i < jSONArray.length(); i++) {
|
||||
JSONArray jSONArray3 = jSONArray.getJSONObject(i).getJSONArray("vlist");
|
||||
for (int i2 = 0; i2 < jSONArray3.length() && i2 < 6; i2++) {
|
||||
JSONObject jSONObject = jSONArray3.getJSONObject(i2);
|
||||
JSONObject jSONObject2 = new JSONObject();
|
||||
jSONObject2.put("vod_id", jSONObject.optString("vod_id"));
|
||||
jSONObject2.put("vod_name", jSONObject.optString("vod_name"));
|
||||
jSONObject2.put("vod_pic", jSONObject.optString("vod_pic"));
|
||||
jSONObject2.put("vod_remarks", jSONObject.optString("vod_remarks"));
|
||||
jSONArray2.put(jSONObject2);
|
||||
}
|
||||
}
|
||||
JSONObject jSONObject3 = new JSONObject();
|
||||
jSONObject3.put("list", jSONArray2);
|
||||
return jSONObject3.toString();
|
||||
} catch (Exception e) {
|
||||
SpiderDebug.log(e);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public void init(Context context) throws Exception {
|
||||
super.init(context);
|
||||
try {
|
||||
this.xr = new JSONArray("[{\"type_name\":\"电视\",\"type_id\":\"2\"},{\"type_name\":\"电影\",\"type_id\":\"1\"},{\"type_name\":\"综艺\",\"type_id\":\"6\"},{\"type_name\":\"动漫\",\"type_id\":\"4\"},{\"type_name\":\"纪录\",\"type_id\":\"3\"},{\"type_name\":\"教育\",\"type_id\":\"12\"},{\"type_name\":\"游戏\",\"type_id\":\"8\"},{\"type_name\":\"资讯\",\"type_id\":\"25\"},{\"type_name\":\"娱乐\",\"type_id\":\"7\"},{\"type_name\":\"财经\",\"type_id\":\"24\"},{\"type_name\":\"网络\",\"type_id\":\"1\"},{\"type_name\":\"片花\",\"type_id\":\"10\"},{\"type_name\":\"音乐\",\"type_id\":\"5\"},{\"type_name\":\"军事\",\"type_id\":\"28\"},{\"type_name\":\"体育\",\"type_id\":\"17\"},{\"type_name\":\"儿童\",\"type_id\":\"15\"},{\"type_name\":\"旅游\",\"type_id\":\"9\"},{\"type_name\":\"时尚\",\"type_id\":\"13\"},{\"type_name\":\"生活\",\"type_id\":\"21\"},{\"type_name\":\"汽车\",\"type_id\":\"26\"},{\"type_name\":\"搞笑\",\"type_id\":\"22\"},{\"type_name\":\"广告\",\"type_id\":\"20\"},{\"type_name\":\"原创\",\"type_id\":\"27\"},{\"type_name\":\"母婴\",\"type_id\":\"29\"},{\"type_name\":\"科技\",\"type_id\":\"30\"},{\"type_name\":\"健康\",\"type_id\":\"32\"}]");
|
||||
this.a = new JSONObject("{\"22\":[{\"name\":\"分类\",\"value\":[{\"v\":\"22169\",\"n\":\"欢乐精选\"},{\"v\":\"29115\",\"n\":\"娱乐八卦\"},{\"v\":\"29116\",\"n\":\"搞笑短片\"},{\"v\":\"29139\",\"n\":\"影视剧吐槽\"},{\"v\":\"22172\",\"n\":\"雷人囧事\"},{\"v\":\"22171\",\"n\":\"爆笑节目\"},{\"v\":\"1905\",\"n\":\"萌宠\"},{\"v\":\"1909\",\"n\":\"童趣\"},{\"v\":\"1900\",\"n\":\"奇闻趣事\"},{\"v\":\"1902\",\"n\":\"恶搞配音\"},{\"v\":\"22170\",\"n\":\"猎奇\"}],\"key\":\"18074\"},{\"name\":\"地域\",\"value\":[{\"v\":\"1907\",\"n\":\"国内\"},{\"v\":\"1908\",\"n\":\"国外\"}],\"key\":\"18075\"}],\"24\":[{\"name\":\"分类\",\"value\":[{\"v\":\"2233\",\"n\":\"宏观\"},{\"v\":\"2234\",\"n\":\"民生\"},{\"v\":\"2235\",\"n\":\"产经\"},{\"v\":\"2236\",\"n\":\"市场\"},{\"v\":\"2237\",\"n\":\"理财\"},{\"v\":\"2238\",\"n\":\"访谈\"}],\"key\":\"18079\"}],\"25\":[{\"name\":\"类型\",\"value\":[{\"v\":\"20031\",\"n\":\"社会\"},{\"v\":\"20321\",\"n\":\"科技\"},{\"v\":\"21314\",\"n\":\"军事\"},{\"v\":\"21315\",\"n\":\"评论\"},{\"v\":\"21739\",\"n\":\"国内\"},{\"v\":\"21740\",\"n\":\"国际\"}],\"key\":\"20030\"}],\"26\":[{\"name\":\"内容\",\"value\":[{\"v\":\"20529\",\"n\":\"资讯\"},{\"v\":\"20530\",\"n\":\"专访\"},{\"v\":\"20531\",\"n\":\"新车\"},{\"v\":\"20532\",\"n\":\"试驾\"},{\"v\":\"20533\",\"n\":\"用车\"},{\"v\":\"20534\",\"n\":\"赛事\"},{\"v\":\"20535\",\"n\":\"交通\"},{\"v\":\"20536\",\"n\":\"娱乐\"},{\"v\":\"20537\",\"n\":\"车模\"},{\"v\":\"20538\",\"n\":\"改装\"},{\"v\":\"20539\",\"n\":\"车微剧\"},{\"v\":\"20540\",\"n\":\"爱汽车制造\"},{\"v\":\"28463\",\"n\":\"品牌\"},{\"v\":\"28464\",\"n\":\"车展\"},{\"v\":\"28534\",\"n\":\"航空\"},{\"v\":\"28535\",\"n\":\"游艇\"},{\"v\":\"28536\",\"n\":\"轨道\"}],\"key\":\"20528\"},{\"name\":\"车型\",\"value\":[{\"v\":\"20542\",\"n\":\"微型车\"},{\"v\":\"20543\",\"n\":\"小型车\"},{\"v\":\"20544\",\"n\":\"紧凑型车\"},{\"v\":\"20545\",\"n\":\"中型车\"},{\"v\":\"20546\",\"n\":\"中高型车\"},{\"v\":\"20547\",\"n\":\"豪华车\"},{\"v\":\"20548\",\"n\":\"MPV\"},{\"v\":\"20549\",\"n\":\"SUV\"},{\"v\":\"20550\",\"n\":\"跑车\"},{\"v\":\"20551\",\"n\":\"皮卡\"},{\"v\":\"20552\",\"n\":\"微客\"},{\"v\":\"22179\",\"n\":\"新概念\"},{\"v\":\"28465\",\"n\":\"电动车\"},{\"v\":\"28466\",\"n\":\"摩托车\"}],\"key\":\"20541\"},{\"name\":\"地区\",\"value\":[{\"v\":\"20554\",\"n\":\"自主品牌\"},{\"v\":\"20555\",\"n\":\"欧洲品牌\"},{\"v\":\"20556\",\"n\":\"亚洲品牌\"},{\"v\":\"20557\",\"n\":\"北美品牌\"}],\"key\":\"20553\"}],\"27\":[{\"name\":\"分类\",\"value\":[{\"v\":\"21317\",\"n\":\"动画\"},{\"v\":\"27986\",\"n\":\"短片\"},{\"v\":\"28034\",\"n\":\"网络剧\"},{\"v\":\"28053\",\"n\":\"创意广告\"},{\"v\":\"21318\",\"n\":\"微电影\"}],\"key\":\"21316\"}],\"28\":[{\"name\":\"分类\",\"value\":[{\"v\":\"21789\",\"n\":\"军情\"},{\"v\":\"21790\",\"n\":\"深度\"},{\"v\":\"21791\",\"n\":\"兵器\"},{\"v\":\"21792\",\"n\":\"战史\"},{\"v\":\"21793\",\"n\":\"人物\"},{\"v\":\"30090\",\"n\":\"航空航天\"}],\"key\":\"21788\"}],\"29\":[{\"name\":\"类型\",\"value\":[{\"v\":\"24083\",\"n\":\"萌宝乐园\"},{\"v\":\"24084\",\"n\":\"孕期\"},{\"v\":\"24085\",\"n\":\"分娩\"},{\"v\":\"24086\",\"n\":\"妈咪饮食\"},{\"v\":\"24087\",\"n\":\"宝宝饮食\"},{\"v\":\"24088\",\"n\":\"早教课堂\"},{\"v\":\"24089\",\"n\":\"婴幼儿常见疾病\"},{\"v\":\"27345\",\"n\":\"时尚辣妈圈\"},{\"v\":\"27350\",\"n\":\"亲子生活馆\"},{\"v\":\"29619\",\"n\":\"宝宝养育\"},{\"v\":\"29746\",\"n\":\"趣味玩具\"},{\"v\":\"30086\",\"n\":\"行业动态\"}],\"key\":\"24082\"},{\"name\":\"年龄段\",\"value\":[{\"v\":\"24121\",\"n\":\"0-1岁\"},{\"v\":\"24122\",\"n\":\"1-3岁\"},{\"v\":\"24123\",\"n\":\"3-6岁\"},{\"v\":\"24124\",\"n\":\"6岁以上\"}],\"key\":\"24120\"}],\"30\":[{\"name\":\"类型\",\"value\":[{\"v\":\"27936\",\"n\":\"评测\"},{\"v\":\"27937\",\"n\":\"教程\"},{\"v\":\"27938\",\"n\":\"活动\"},{\"v\":\"27939\",\"n\":\"广告\"},{\"v\":\"27974\",\"n\":\"资讯\"},{\"v\":\"28522\",\"n\":\"专访\"},{\"v\":\"27975\",\"n\":\"其他\"}],\"key\":\"24125\"},{\"name\":\"地区\",\"value\":[{\"v\":\"24132\",\"n\":\"国内\"},{\"v\":\"24133\",\"n\":\"国际\"}],\"key\":\"24131\"},{\"name\":\"内容\",\"value\":[{\"v\":\"27972\",\"n\":\"IT业界\"},{\"v\":\"27973\",\"n\":\"互联网\"},{\"v\":\"28521\",\"n\":\"APP\"},{\"v\":\"27942\",\"n\":\"手机\"},{\"v\":\"27943\",\"n\":\"笔记本\"},{\"v\":\"27944\",\"n\":\"智能硬件\"},{\"v\":\"27945\",\"n\":\"平板电脑\"},{\"v\":\"27946\",\"n\":\"数码相机\"},{\"v\":\"27948\",\"n\":\"PC\"},{\"v\":\"27949\",\"n\":\"家电\"},{\"v\":\"27950\",\"n\":\"游戏机\"},{\"v\":\"27951\",\"n\":\"前沿技术\"},{\"v\":\"27952\",\"n\":\"科学探索\"},{\"v\":\"27953\",\"n\":\"爱科技出品\"}],\"key\":\"27940\"}],\"31\":[{\"name\":\"语言\",\"value\":[{\"v\":\"27515\",\"n\":\"Line truncated
|
||||
} catch (JSONException e) {
|
||||
SpiderDebug.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
public String join(@NonNull CharSequence charSequence, @NonNull Iterable iterable) {
|
||||
Iterator it = iterable.iterator();
|
||||
if (it.hasNext()) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(it.next());
|
||||
while (it.hasNext()) {
|
||||
sb.append(charSequence);
|
||||
sb.append(it.next());
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String playerContent(String str, String str2, List<String> list) {
|
||||
try {
|
||||
JSONObject jSONObject = new JSONObject();
|
||||
try {
|
||||
jSONObject.put("parse", 1);
|
||||
jSONObject.put("playUrl", "");
|
||||
jSONObject.put("url", str2);
|
||||
return jSONObject.toString();
|
||||
} catch (Exception e) {
|
||||
SpiderDebug.log(e);
|
||||
return jSONObject.toString();
|
||||
}
|
||||
} catch (Exception e2) {
|
||||
SpiderDebug.log(e2);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String searchContent(String str, boolean z) {
|
||||
try {
|
||||
String str2 = "https://search.video.iqiyi.com/o?if=html5&key=" + str + "&pageNum=1&pos=1&pageSize=20";
|
||||
JSONArray optJSONArray = new JSONObject(OkHttp.string(str2, dn(str2))).optJSONObject("data").optJSONArray("docinfos");
|
||||
JSONArray jSONArray = new JSONArray();
|
||||
for (int i = 0; i < optJSONArray.length(); i++) {
|
||||
JSONObject optJSONObject = optJSONArray.getJSONObject(i).optJSONObject("albumDocInfo");
|
||||
JSONObject jSONObject = new JSONObject();
|
||||
String optString = optJSONObject.optString("albumLink");
|
||||
if (optJSONObject.optInt("album_type") == 0) {
|
||||
jSONObject.put("vod_id", "/albums/album/avlistinfo?aid=" + optJSONObject.optString("qipu_id") + "&size=5000&page=1&url=" + optString);
|
||||
jSONObject.put("vod_name", optJSONObject.optString("albumTitle"));
|
||||
jSONObject.put("vod_pic", optJSONObject.optString("albumImg"));
|
||||
jSONObject.put("vod_remarks", optJSONObject.optString("releaseDate"));
|
||||
jSONArray.put(jSONObject);
|
||||
}
|
||||
}
|
||||
JSONObject jSONObject2 = new JSONObject();
|
||||
jSONObject2.put("list", jSONArray);
|
||||
return jSONObject2.toString();
|
||||
} catch (Exception e) {
|
||||
SpiderDebug.log(e);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user