| | |
| | | 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; |
| | |
| | | |
| | | @Resource |
| | | private VideoResourceInfoMapService videoResourceInfoMapService; |
| | | |
| | | @Resource |
| | | private HanmiUtil hanmiUtil; |
| | | |
| | | private final Logger userPlayLogger = LoggerFactory.getLogger("videoPlayUser"); |
| | | |
| | |
| | | |
| | | |
| | | 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) { |
| | |
| | | try { |
| | | info = tencentVideoUtil.getVideoInfo(internetSearchVideo, pageSize); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | logger.error("全网搜视频详情出错:" + videoId); |
| | | out.print(JsonUtil.loadFalseAdmin(e.getMessage())); |
| | | return; |
| | |
| | | } 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())); |
| | |
| | | } |
| | | |
| | | |
| | | // 获取韩剧的播放链接 |
| | | 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"); |