|
|
|
|
@ -2,6 +2,8 @@ package com.fongmi.android.tv.api.loader; |
|
|
|
|
|
|
|
|
|
import com.fongmi.android.tv.api.config.LiveConfig; |
|
|
|
|
import com.fongmi.android.tv.api.config.VodConfig; |
|
|
|
|
import com.fongmi.android.tv.bean.Live; |
|
|
|
|
import com.fongmi.android.tv.bean.Site; |
|
|
|
|
import com.github.catvod.crawler.Spider; |
|
|
|
|
import com.github.catvod.crawler.SpiderNull; |
|
|
|
|
|
|
|
|
|
@ -49,10 +51,10 @@ public class BaseLoader { |
|
|
|
|
|
|
|
|
|
public Spider getSpider(Map<String, String> params) { |
|
|
|
|
if (!params.containsKey("siteKey")) return new SpiderNull(); |
|
|
|
|
boolean live = params.containsKey("live") && "true".equals(params.get("live")); |
|
|
|
|
boolean vod = !params.containsKey("live") || "false".equals(params.get("live")); |
|
|
|
|
if (live) return LiveConfig.get().getLive(params.get("siteKey")).spider(); |
|
|
|
|
if (vod) return VodConfig.get().getSite(params.get("siteKey")).spider(); |
|
|
|
|
Live live = LiveConfig.get().getLive(params.get("siteKey")); |
|
|
|
|
Site site = VodConfig.get().getSite(params.get("siteKey")); |
|
|
|
|
if (!site.isEmpty()) return site.spider(); |
|
|
|
|
if (!live.isEmpty()) return live.spider(); |
|
|
|
|
return new SpiderNull(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|