From 19533a17aa55fafc70d0a385928e785cb50e1ebc Mon Sep 17 00:00:00 2001 From: admin <2780501319@qq.com> Date: 星期五, 30 七月 2021 02:05:14 +0800 Subject: [PATCH] 爱奇艺视频更新 --- src/main/java/com/yeshi/buwan/iqiyi/IqiYiNewAPI.java | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 53 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/yeshi/buwan/iqiyi/IqiYiNewAPI.java b/src/main/java/com/yeshi/buwan/iqiyi/IqiYiNewAPI.java index 5f4e64c..356f176 100644 --- a/src/main/java/com/yeshi/buwan/iqiyi/IqiYiNewAPI.java +++ b/src/main/java/com/yeshi/buwan/iqiyi/IqiYiNewAPI.java @@ -17,10 +17,10 @@ public class IqiYiNewAPI { - public static int TYPE_DIANYING = 1; - public static int TYPE_DIANSHIJU = 2;//鐢佃鍓� - public static int TYPE_ZONGYI = 6;//缁艰壓 - public static int TYPE_DONGMAN = 4;//鍔ㄦ极 + public final static int TYPE_DIANYING = 1; + public final static int TYPE_DIANSHIJU = 2;//鐢佃鍓� + public final static int TYPE_ZONGYI = 6;//缁艰壓 + public final static int TYPE_DONGMAN = 4;//鍔ㄦ极 public static int TYPE_YULE = 7;//濞变箰 public static int TYPE_KEJI = 30;//绉戞妧 @@ -187,6 +187,16 @@ return null; } + public static IqiyiAlbum2 getAlbumOrVideoDetail(Long id) { + List<Long> ids = new ArrayList<>(); + ids.add(id); + List<IqiyiAlbum2> list = getAlbumOrVideoDetail(ids); + + if (list != null && list.size() > 0) + return list.get(0); + return null; + } + /** * 鑾峰彇鏇存柊鐨勪笓杈� * @@ -313,6 +323,45 @@ } + public static String getIdByUrl(String url) { + Map<String, String> params = new HashMap<>(); + params.put("playurl", url); + params.put("rec", "0"); + String result = baseRquest("http://expand.video.iqiyi.com/c/fb", params); + System.out.println(result); + if (!StringUtil.isNullOrEmpty(result)) { + JSONObject object = JSONObject.fromObject(result); + if (object != null) { + if ("A00000".equalsIgnoreCase(object.optString("code"))) {// 鎴愬姛 + List<IqiyiAlbum2> albumList = new ArrayList<>(); + JSONObject obj = object.optJSONObject("data"); + return obj.optString("qipuId"); + } + } + } + return null; + } + + public static String getAidByUrl(String url) { + Map<String, String> params = new HashMap<>(); + params.put("playurl", url); + params.put("rec", "0"); + String result = baseRquest("http://expand.video.iqiyi.com/c/fb", params); + System.out.println(result); + if (!StringUtil.isNullOrEmpty(result)) { + JSONObject object = JSONObject.fromObject(result); + if (object != null) { + if ("A00000".equalsIgnoreCase(object.optString("code"))) {// 鎴愬姛 + List<IqiyiAlbum2> albumList = new ArrayList<>(); + JSONObject obj = object.optJSONObject("data"); + return obj.optString("albumQipuId"); + } + } + } + return null; + } + + private static Gson gson = null; static class DoubleTypeAdapter implements JsonDeserializer<Double> { -- Gitblit v1.8.0