| | |
| | | import com.google.gson.Gson; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.yeshi.buwan.iqiyi.IqiYiNewAPI; |
| | | import com.yeshi.buwan.iqiyi.entity.IqiyiAlbum2; |
| | | import com.yeshi.buwan.service.manager.search.SolrAlbumVideoDataManager; |
| | | import com.yeshi.buwan.videos.iqiyi.IqiYiNewAPI; |
| | | import com.yeshi.buwan.videos.iqiyi.entity.IqiyiAlbum2; |
| | | import com.yeshi.buwan.service.manager.search.SolrShortVideoDataManager; |
| | | import com.yeshi.buwan.tencent.TencentVideoUtil; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.factory.SolrShortVideoFactory; |
| | | import com.yeshi.buwan.util.video.shortvideo.IqiyiWebUtil; |
| | | import com.yeshi.buwan.util.video.shortvideo.TencentWebUtil; |
| | | import net.sf.json.JSONObject; |
| | | import com.yeshi.buwan.util.video.web.IqiyiWebUtil; |
| | | import com.yeshi.buwan.util.video.web.TencentWebUtil; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public ReturnT<String> updateIqiyiShortVideo(String param) throws Exception { |
| | | URLParams urlParams = getParams(param); |
| | | |
| | | for (int i = 0; i < 20; i++) { |
| | | for (int i = 19; i >= 0; i--) { |
| | | try { |
| | | List<Long> idList = IqiyiWebUtil.getVideoTvidList(IqiyiWebUtil.parseParams(urlParams.getUrl()), i + 1); |
| | | if (idList.size() == 0) { |
| | | break; |
| | | continue; |
| | | } |
| | | Collections.reverse(idList); |
| | | //保存 |
| | | for (Long id : idList) { |
| | | IqiyiAlbum2 album = IqiYiNewAPI.getAlbumOrVideoDetail(id); |
| | |
| | | throw new Exception("area不能为空"); |
| | | } |
| | | |
| | | for (int i = 0; i < 20; i++) { |
| | | for (int i = 19; i >= 0; i--) { |
| | | try { |
| | | List<TencentWebUtil.TencentWebVideoInfo> list = TencentWebUtil.getVideoList(TencentWebUtil.parseParams(urlParams.getUrl()), i + 1); |
| | | if (list.size() == 0) |
| | | break; |
| | | continue; |
| | | Collections.reverse(list); |
| | | for (TencentWebUtil.TencentWebVideoInfo videoInfo : list) { |
| | | solrShortVideoDataManager.saveOrUpdate(SolrShortVideoFactory.create(videoInfo, urlParams.getArea(), urlParams.getVideoType())); |
| | | } |