| | |
| | | |
| | | 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.util.IqiyiUtil2; |
| | | import com.yeshi.buwan.videos.iqiyi.IqiYiNewAPI; |
| | | import com.yeshi.buwan.videos.iqiyi.util.IqiyiUtil2; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Component |
| | | public class Iqiyi2VideoUpdate { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(Iqiyi2VideoUpdate.class); |
| | | |
| | | @Resource |
| | | private IqiyiUtil2 iqiyiUtil2; |
| | |
| | | List<String> urlList = IqiyiUtil2.getAlbumUrlsFromUrl(param); |
| | | for (String url : urlList) { |
| | | String aid = IqiYiNewAPI.getAidByUrl(url); |
| | | iqiyiUtil2.syncByAid(Long.parseLong(aid)); |
| | | iqiyiUtil2.syncByAid(Long.parseLong(aid),false); |
| | | logger.info("更新专辑:" + aid); |
| | | } |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 根据视频播放链接更新专辑 |
| | | * |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("video-update-iqiyi-updateVideoByPlayerUrl") |
| | | public ReturnT<String> updateVideoByPlayerUrl(String param) throws Exception { |
| | | String aid = IqiYiNewAPI.getAidByUrl(param); |
| | | iqiyiUtil2.syncByAid(Long.parseLong(aid),false); |
| | | logger.info("更新专辑:" + aid); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | @XxlJob("video-update-iqiyi-updateVideoByChannelId") |
| | | public ReturnT<String> updateVideoByChannelId(String param) throws Exception { |
| | | String[] params = param.split(","); |
| | | for (String p : params) { |
| | | int channelId = Integer.parseInt(p); |
| | | iqiyiUtil2.updateTodayAlbumAndVideo(channelId); |
| | | logger.info("更新当天专辑:" + channelId); |
| | | } |
| | | return ReturnT.SUCCESS; |
| | | } |