TGsou百度

This commit is contained in:
lushunming 2025-10-15 08:53:26 +08:00
parent c9ebf3c7d7
commit ccf4c0b068
4 changed files with 52 additions and 51 deletions

View File

@ -11,12 +11,8 @@ import com.github.catvod.utils.Util;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import java.util.ArrayList;
import java.util.HashMap; import java.util.*;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class TgSearchBaidu extends Cloud { public class TgSearchBaidu extends Cloud {
private static final String KEY_API_URLS = "api_urls"; private static final String KEY_API_URLS = "api_urls";
@ -58,7 +54,8 @@ public class TgSearchBaidu extends Cloud {
this.extInfos = new String[]{extend}; this.extInfos = new String[]{extend};
processExtendConfig(extend); processExtendConfig(extend);
} }
} catch (Exception e) {} } catch (Exception e) {
}
} }
this.extInfos = null; // 重置避免内存泄漏 this.extInfos = null; // 重置避免内存泄漏
} }
@ -111,7 +108,11 @@ public class TgSearchBaidu extends Cloud {
String domain = entry.getKey(); String domain = entry.getKey();
String sourceName = ""; String sourceName = "";
try { sourceName = entry.getValue().getAsString(); } catch (Exception e) { continue; } try {
sourceName = entry.getValue().getAsString();
} catch (Exception e) {
continue;
}
if (!TextUtils.isEmpty(domain) && !TextUtils.isEmpty(sourceName) && !domainMap.containsKey(domain)) { if (!TextUtils.isEmpty(domain) && !TextUtils.isEmpty(sourceName) && !domainMap.containsKey(domain)) {
domainMap.put(domain, sourceName); domainMap.put(domain, sourceName);
@ -143,7 +144,6 @@ public class TgSearchBaidu extends Cloud {
} }
private Map<String, String> getHeader() { private Map<String, String> getHeader() {
Map<String, String> header = new HashMap<>(); Map<String, String> header = new HashMap<>();
header.put("User-Agent", Util.CHROME); header.put("User-Agent", Util.CHROME);
@ -176,7 +176,8 @@ public class TgSearchBaidu extends Cloud {
if (result.getCode() == 500 || TextUtils.isEmpty(result.getBody())) continue; if (result.getCode() == 500 || TextUtils.isEmpty(result.getBody())) continue;
JsonObject jsonObject = Json.safeObject(result.getBody()); JsonObject jsonObject = Json.safeObject(result.getBody());
if (!jsonObject.has("code") || jsonObject.get("code").getAsInt() != 0 || !jsonObject.has("data")) continue; if (!jsonObject.has("code") || jsonObject.get("code").getAsInt() != 0 || !jsonObject.has("data"))
continue;
JsonObject data = jsonObject.getAsJsonObject("data"); JsonObject data = jsonObject.getAsJsonObject("data");
@ -211,7 +212,7 @@ public class TgSearchBaidu extends Cloud {
String pic = getFirstImage(entry); String pic = getFirstImage(entry);
// 简化VodPlayBuilder的使用 // 简化VodPlayBuilder的使用
Vod vod = new Vod("push://" + vodUrl, title, pic, sourceName + " (" + originalSource + ")"); Vod vod = new Vod(vodUrl, title, pic, sourceName + " (" + originalSource + ")");
// 由于只有一个播放源直接设置播放信息 // 由于只有一个播放源直接设置播放信息
vod.setVodPlayFrom(sourceName); vod.setVodPlayFrom(sourceName);
vod.setVodPlayUrl("播放源$" + vodUrl); vod.setVodPlayUrl("播放源$" + vodUrl);

Binary file not shown.

View File

@ -1 +1 @@
3a9716ee845abbc8cc2daf9b812128f0 1b4f17a721470f8b074d883d9d4c4839

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://andoridspidermt.netlify.app/jar/custom_spider.jar;md5;3a9716ee845abbc8cc2daf9b812128f0", "spider": "https://andoridspidermt.netlify.app/jar/custom_spider.jar;md5;1b4f17a721470f8b074d883d9d4c4839",
"lives": [ "lives": [
{ {
"name": "电视直播", "name": "电视直播",