Optimize live spider

pull/586/head
FongMi 1 year ago
parent 698afad14b
commit 45790659da
  1. 6
      app/src/main/java/com/fongmi/android/tv/api/LiveParser.java
  2. 2
      catvod/src/main/java/com/github/catvod/crawler/Spider.java
  3. 4
      chaquo/src/main/java/com/fongmi/chaquo/Spider.java
  4. 4
      chaquo/src/main/python/app.py
  5. 2
      chaquo/src/main/python/base/spider.py
  6. 4
      chaquo/src/main/python/runner.py
  7. 4
      chaquo/src/main/python/trigger.py
  8. 4
      quickjs/src/main/java/com/fongmi/quickjs/crawler/Spider.java

@ -47,7 +47,7 @@ public class LiveParser {
if (!live.getGroups().isEmpty()) return;
if (live.getType() == 0) text(live, getText(live));
if (live.getType() == 1) json(live, getText(live));
if (live.getType() == 3) spider(live, getText(live));
if (live.getType() == 3) spider(live);
}
public static void text(Live live, String text) {
@ -72,8 +72,8 @@ public class LiveParser {
}
}
private static void spider(Live live, String text) throws Exception {
if (text.isEmpty()) text = live.spider().liveContent();
private static void spider(Live live) throws Exception {
String text = live.spider().liveContent(UrlUtil.convert(live.getUrl()));
if (Json.valid(text)) json(live, text);
else text(live, text);
}

@ -48,7 +48,7 @@ public abstract class Spider {
return "";
}
public String liveContent() throws Exception {
public String liveContent(String url) throws Exception {
return "";
}

@ -75,8 +75,8 @@ public class Spider extends com.github.catvod.crawler.Spider {
}
@Override
public String liveContent() {
return app.callAttr("liveContent", obj).toString();
public String liveContent(String url) {
return app.callAttr("liveContent", obj, url).toString();
}
@Override

@ -86,8 +86,8 @@ def playerContent(ru, flag, id, vipFlags):
return formatJo
def liveContent(ru):
result = ru.liveContent()
def liveContent(ru, url):
result = ru.liveContent(url)
return result

@ -45,7 +45,7 @@ class Spider(metaclass=ABCMeta):
def playerContent(self, flag, id, vipFlags):
pass
def liveContent(self):
def liveContent(self, url):
pass
def localProxy(self, param):

@ -29,8 +29,8 @@ class Runner():
def playerContent(self, flag, id, vipFlags):
return self.spider.playerContent(flag, id, vipFlags)
def liveContent(self):
return self.spider.liveContent()
def liveContent(self, url):
return self.spider.liveContent(url)
def localProxy(self, param):
return self.spider.localProxy(param)

@ -28,8 +28,8 @@ class Trigger():
return sp_obj.playerContent(flag, id, vipFlags)
@staticmethod
def liveContent(sp_obj):
return sp_obj.liveContent()
def liveContent(sp_obj, url):
return sp_obj.liveContent(url)
@staticmethod
def isVideoFormat(sp_obj, url):

@ -104,8 +104,8 @@ public class Spider extends com.github.catvod.crawler.Spider {
}
@Override
public String liveContent() throws Exception {
return (String) call("live");
public String liveContent(String url) throws Exception {
return (String) call("live", url);
}
@Override

Loading…
Cancel
Save