| | |
| | | |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.yeshi.buwan.mogotv.MogoTVApiUtil; |
| | | import com.yeshi.buwan.mogotv.entity.MogoTVClipInfo; |
| | | import com.yeshi.buwan.mogotv.entity.MogoTVVideo; |
| | | import com.yeshi.buwan.service.inter.juhe.MogoTVService; |
| | | import com.yeshi.buwan.service.inter.juhe.TencentVideoService; |
| | | import com.yeshi.buwan.tencent.TencentVideoApiUtil; |
| | | import com.yeshi.buwan.tencent.TencentVideoUtil; |
| | | import com.yeshi.buwan.tencent.entity.TencentCoverInfo; |
| | | import com.yeshi.buwan.videos.tencent.TencentVideoApiUtil; |
| | | import com.yeshi.buwan.videos.tencent.entity.TencentCoverInfo; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.video.web.TencentWebUtil; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | int totalPage = 50; |
| | | for (int i = 0; i < totalPage; i++) { |
| | | List<TencentCoverInfo> coverInfoList = TencentVideoApiUtil.getVideoListByCategory(channel, i + 1); |
| | | save(coverInfoList); |
| | | } |
| | | } |
| | | |
| | | private void save(List<TencentCoverInfo> coverInfoList) { |
| | | if (coverInfoList != null) |
| | | for (TencentCoverInfo coverInfo : coverInfoList) { |
| | | System.out.println(coverInfo.getTitle()+":"+coverInfo.getCover_id()); |
| | | System.out.println(coverInfo.getTitle() + ":" + coverInfo.getCover_id()); |
| | | try { |
| | | tencentVideoService.addToInternetSearch(coverInfo); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private String getChannel(String cate) throws Exception { |
| | |
| | | } |
| | | |
| | | |
| | | @XxlJob("video-update-tencent-updateVideo-byweburl") |
| | | public ReturnT<String> updateLatestVideoByWebUrl(String param) throws Exception { |
| | | JSONObject json = JSONObject.fromObject(param); |
| | | int page = json.optInt("page"); |
| | | String url = json.optString("url"); |
| | | List<TencentCoverInfo> list = TencentVideoApiUtil.getVideoList(TencentWebUtil.getApiUrl(url, page)); |
| | | save(list); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 更新单个视频 |
| | | * |