From 6a53e9a4beff70bfb46cd780c64e354aace1a6fb Mon Sep 17 00:00:00 2001 From: FongMi Date: Tue, 23 Aug 2022 23:54:01 +0800 Subject: [PATCH] Update Push.java --- .../java/com/github/catvod/spider/Push.java | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/github/catvod/spider/Push.java b/app/src/main/java/com/github/catvod/spider/Push.java index df94d167..12e731cb 100644 --- a/app/src/main/java/com/github/catvod/spider/Push.java +++ b/app/src/main/java/com/github/catvod/spider/Push.java @@ -11,18 +11,12 @@ public class Push extends Spider { @Override public String detailContent(List ids) { - try { - String url = ids.get(0).trim(); - Vod vod = new Vod(); - if (Misc.isVip(url)) setVod(vod, url, "官源"); - else if (Misc.isVideoFormat(url)) setVod(vod, url, "直連"); - else if (url.startsWith("magnet")) setVod(vod, url, "磁力"); - else if (url.startsWith("http")) setVod(vod, url, "網頁"); - return Result.string(vod); - } catch (Exception e) { - e.printStackTrace(); - return ""; - } + String url = ids.get(0).trim(); + if (Misc.isVip(url)) return Result.string(vod(url, "官源")); + else if (Misc.isVideoFormat(url)) return Result.string(vod(url, "直連")); + else if (url.startsWith("magnet")) return Result.string(vod(url, "磁力")); + else if (url.startsWith("http")) return Result.string(vod(url, "網頁")); + else return ""; } @Override @@ -36,12 +30,14 @@ public class Push extends Spider { } } - private void setVod(Vod vod, String url, String type) { + private Vod vod(String url, String type) { + Vod vod = new Vod(); vod.setTypeName(type); vod.setVodId(url); vod.setVodName(url); vod.setVodPlayFrom(type); vod.setVodPlayUrl("播放$" + url); vod.setVodPic("https://pic.rmb.bdstatic.com/bjh/1d0b02d0f57f0a42201f92caba5107ed.jpeg"); + return vod; } } \ No newline at end of file