admin
2024-09-05 ab35ac8b769b2d9816dffb33a64f2c6f7bd5dd6e
src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java
@@ -15,6 +15,7 @@
import com.yeshi.buwan.exception.video.VideoPlayException;
import com.yeshi.buwan.service.inter.video.VideoResourceInfoMapService;
import com.yeshi.buwan.service.manager.APPManager;
import com.yeshi.buwan.videos.hanmi.HanmiUtil;
import com.yeshi.buwan.videos.mogotv.MogoTVUtil;
import com.yeshi.buwan.videos.pptv.PPTVApiUtil;
import com.yeshi.buwan.videos.pptv.PPTVUtil;
@@ -124,6 +125,9 @@
    @Resource
    private VideoResourceInfoMapService videoResourceInfoMapService;
    @Resource
    private HanmiUtil hanmiUtil;
    private final Logger userPlayLogger = LoggerFactory.getLogger("videoPlayUser");
@@ -375,7 +379,7 @@
    public HomeType convertHomeVideoList(HomeType type) {
        List<VideoInfo> vlist = new ArrayList<VideoInfo>();
        List<VideoInfo> vlist = new ArrayList<>();
        List<HomeVideo> list = type.getHomeVideoList();
        if (list != null)
            for (HomeVideo hv : list) {
@@ -634,6 +638,7 @@
            try {
                info = tencentVideoUtil.getVideoInfo(internetSearchVideo, pageSize);
            } catch (Exception e) {
                e.printStackTrace();
                logger.error("全网搜视频详情出错:" + videoId);
                out.print(JsonUtil.loadFalseAdmin(e.getMessage()));
                return;
@@ -641,6 +646,14 @@
        } else if (Integer.parseInt(resourceId) == BilibiliUtil.RESOURCE_ID) {
            try {
                info = bilibiliUtil.getVideoInfo(internetSearchVideo, pageSize);
            } catch (Exception e) {
                logger.error("全网搜视频详情出错:" + videoId);
                out.print(JsonUtil.loadFalseAdmin(e.getMessage()));
                return;
            }
        }else if (Integer.parseInt(resourceId) == HanmiUtil.RESOURCE_ID) {
            try {
                info = hanmiUtil.getVideoInfo(internetSearchVideo, pageSize);
            } catch (Exception e) {
                logger.error("全网搜视频详情出错:" + videoId);
                out.print(JsonUtil.loadFalseAdmin(e.getMessage()));
@@ -1251,6 +1264,55 @@
    }
    // 获取韩剧的播放链接
    public void getHjPlayUrl(AcceptData acceptData, HttpServletRequest request, PrintWriter out) {
        String resourceId = request.getParameter("ResourceId");
        String id = request.getParameter("Id");
        String eid = request.getParameter("EId");
        String type = request.getParameter("Type");
        String videoId = request.getParameter("VideoId");
        if (StringUtil.isNullOrEmpty(resourceId)) {
            out.print(JsonUtil.loadFalseJson("请上传ResourceId"));
            return;
        }
        if (StringUtil.isNullOrEmpty(id) && StringUtil.isNullOrEmpty(eid)) {
            out.print(JsonUtil.loadFalseJson("请上传id"));
            return;
        }
//        if (StringUtil.isNullOrEmpty(type)) {
//            out.print(JsonUtil.loadFalseJson("请上传type"));
//            return;
//        }
        if (StringUtil.isNullOrEmpty(id))
            id = eid;
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName());
        PlayUrl pu = null;
        try {
            pu = videoDeailUtil.getPlayUrl(acceptData, detailSystem.getId(), id, type, Integer.parseInt(resourceId), videoId);
        } catch (VideoPlayException e) {
            e.printStackTrace();
        }
        if (pu != null) {
            if (!StringUtil.isNullOrEmpty(pu.getUrl()))
                pu.setUrl(pu.getUrl());
            JSONObject object = JSONObject.fromObject(StringUtil.outPutResultJson(pu));
            out.print(JsonUtil.loadTrueJson(object.toString()));
        } else {
            out.print(JsonUtil.loadFalseJson("找不到该视频"));
        }
    }
    public List<HomeVideo> getZhiBoVideoList() throws Exception {
        List<HomeVideo> list = new ArrayList<HomeVideo>();
        String result = get("http://www.kktv1.com/CDN/output/M/3/I/10002002/P/start-0_offset-6_platform-2/json.js");