| | |
| | | import com.yeshi.buwan.pptv.entity.PPTVSeries; |
| | | import com.yeshi.buwan.service.inter.LoginUserService; |
| | | import com.yeshi.buwan.service.inter.juhe.PPTVService; |
| | | import com.yeshi.buwan.util.log.LoggerUtil; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.test.context.ContextConfiguration; |
| | | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; |
| | | import org.springframework.test.context.web.WebAppConfiguration; |
| | | import org.yeshi.utils.HtmlToolUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void login() { |
| | | PPTVApiUtil.login("zcoAY6ev7RpYSLzXKtWybniCK+sgBiCARUii_uyNdFw-"); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void getApiDetail() { |
| | |
| | | public void getOpenId() { |
| | | //CODE:XefbSM0H8BC9kaEGEjHF2U7wd6Sd9ec1oSUmG1gZDTg= |
| | | // PPTVApiUtil.login("XefbSM0H8BC9kaEGEjHF2U7wd6Sd9ec1oSUmG1gZDTg="); |
| | | String pptvUid = PPTVUtil.decryptPPTVCode("XefbSM0H8BC9kaEGEjHF2U7wd6Sd9ec1oSUmG1gZDTg=").pptvUid; |
| | | String pptvUid = "buwan_844600";//PPTVUtil.decryptPPTVCode("XefbSM0H8BC9kaEGEjHF2U7wd6Sd9ec1oSUmG1gZDTg=").pptvUid; |
| | | String openId = PPTVApiUtil.getOpenId(pptvUid); |
| | | System.out.println(openId); |
| | | |
| | |
| | | |
| | | @Test |
| | | public void addVideoInfo() { |
| | | PPTVSeries series = pptvService.getSeriesDetail("4205"); |
| | | PPTVSeries series = pptvService.getSeriesDetail("26796"); |
| | | pptvService.addToVideoInfo(series); |
| | | } |
| | | |
| | | @Test |
| | | public void offline() { |
| | | List<String[]> list = HtmlToolUtil.parseSQLYogExportHtmData("C:\\Users\\Administrator\\Desktop\\草稿\\PPTV重复的电视剧.htm", 1); |
| | | for (int i = 1000; i < list.size(); i++) { |
| | | String[] sts = list.get(i); |
| | | String name = sts[0]; |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("name").is(name)); |
| | | PPTVSeries series = pptvSeriesDao.findOne(query); |
| | | if (series != null) { |
| | | pptvService.offLineSeries(series.getInfoID()); |
| | | //添加到详情 |
| | | try { |
| | | Thread.sleep(1000 * 3L); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | series = pptvService.getSeriesDetail(series.getInfoID()); |
| | | pptvService.addToVideoInfo(series); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void reAddVideo(){ |
| | | reAdd("武林外传"); |
| | | } |
| | | |
| | | private void reAdd(String name) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("name").is(name)); |
| | | PPTVSeries series = pptvSeriesDao.findOne(query); |
| | | if (series != null) { |
| | | pptvService.offLineSeries(series.getInfoID()); |
| | | //添加到详情 |
| | | try { |
| | | Thread.sleep(1000 * 3L); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | series = pptvService.getSeriesDetail(series.getInfoID()); |
| | | pptvService.addToVideoInfo(series); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void logs() { |
| | | LoggerUtil.getVIPLogger().info("123123"); |
| | | } |
| | | |
| | | |
| | | } |