| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.yeshi.buwan.dao.juhe.iqiyi.IqiyiAlbum2Dao; |
| | | import com.yeshi.buwan.dao.juhe.iqiyi.VideoIqiyi2Dao; |
| | | import com.yeshi.buwan.dao.juhe.iqiyi.VideoIqiyiDao; |
| | | import com.yeshi.buwan.domain.ResourceVideo; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoResource; |
| | | import com.yeshi.buwan.iqiyi.IqiYiNewAPI; |
| | | import com.yeshi.buwan.iqiyi.entity.IqiyiAlbum2; |
| | | import com.yeshi.buwan.iqiyi.entity.VideoIqiyi; |
| | | import com.yeshi.buwan.iqiyi.util.IqiyiUtil2; |
| | | import com.yeshi.buwan.iqiyi.vo.IqiyiAlbumListResult; |
| | | import com.yeshi.buwan.exception.video.IqiyiVideoSolrException; |
| | | import com.yeshi.buwan.videos.iqiyi.IqiYiNewAPI; |
| | | import com.yeshi.buwan.videos.iqiyi.entity.IqiyiAlbum2; |
| | | import com.yeshi.buwan.videos.iqiyi.entity.VideoIqiyi; |
| | | import com.yeshi.buwan.videos.iqiyi.util.IqiyiUtil2; |
| | | import com.yeshi.buwan.videos.iqiyi.vo.IqiyiAlbumListResult; |
| | | import com.yeshi.buwan.job.video.Iqiyi2VideoUpdate; |
| | | import com.yeshi.buwan.query.Iqiyi2AlbumQuery; |
| | | import com.yeshi.buwan.service.imp.CategoryVideoService; |
| | |
| | | import org.junit.runner.RunWith; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.orm.hibernate4.HibernateObjectRetrievalFailureException; |
| | | import org.springframework.test.context.ContextConfiguration; |
| | | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; |
| | | import org.springframework.test.context.web.WebAppConfiguration; |
| | |
| | | |
| | | @Test |
| | | public void syncOne() { |
| | | iqiyiUtil2.syncByAid(111367401L); |
| | | iqiyiUtil2.syncByAid(111367401L, true); |
| | | // iqiyiUtil2.syncByAid(253393601L); |
| | | // iqiyiUtil2.syncByAid(253305701L); |
| | | // iqiyiUtil2.syncByAid(247742201L); |
| | |
| | | // iqiyi2Service.addToVideoInfo(album2); |
| | | // } |
| | | |
| | | Long qikuID = 6544570339302501L; |
| | | Long qikuID = 6917577458483001L; |
| | | |
| | | IqiyiAlbum2 album2 = iqiyi2Service.selectAlbumById(qikuID); |
| | | if (album2 != null) { |
| | |
| | | List<String> urlList = IqiyiUtil2.getAlbumUrlsFromUrl("https://www.iqiyi.com/v_u3d4t2dr7o.html?vfrm=pcw_dianshiju&vfrmblk=B&vfrmrst=fcs_2_p2"); |
| | | for (String url : urlList) { |
| | | String aid = IqiYiNewAPI.getAidByUrl(url); |
| | | iqiyiUtil2.syncByAid(Long.parseLong(aid)); |
| | | iqiyiUtil2.syncByAid(Long.parseLong(aid), true); |
| | | } |
| | | } |
| | | |
| | |
| | | public void count() { |
| | | // long count = iqiyiAlbum2Dao.countVideoByAid(253120001L); |
| | | // System.out.println(count); |
| | | IqiyiAlbum2 album2 = iqiyiAlbum2Dao.get(7974832045751601L); |
| | | IqiyiAlbum2 album2 = iqiyiAlbum2Dao.get(2928406697871201L); |
| | | iqiyi2Service.addToVideoInfo(album2); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private VideoIqiyi2Dao videoIqiyi2Dao; |
| | | |
| | | @Test |
| | | public void getDetail() { |
| | | iqiyiUtil2.syncByAid(222728201L); |
| | | |
| | | |
| | | iqiyiUtil2.syncByAid(2928406697871201L, true); |
| | | // System.out.println(album2); |
| | | } |
| | | |
| | | //同步爱奇艺的专题 |
| | | @Test |
| | | public void syncIqiyiAlbum() throws IOException { |
| | | //写入爱奇艺ID |
| | | // File f = new File("D:/iqiyi.txt"); |
| | | // f.delete(); |
| | | // if (!f.exists()) |
| | | // f.createNewFile(); |
| | | // BufferedWriter out = new BufferedWriter(new FileWriter(f.getAbsolutePath())); |
| | | // try { |
| | | // for (int i = 0; i < 261; i++) { |
| | | // List<VideoIqiyi2> list = videoIqiyi2Dao.listAll(i*100, 100); |
| | | // for (VideoIqiyi2 iqiyi2 : list) { |
| | | // out.write(iqiyi2.getIqiyiId() + ""); |
| | | // out.newLine(); |
| | | // } |
| | | // } |
| | | // } finally { |
| | | // out.close(); |
| | | // } |
| | | |
| | | List<String> list = new ArrayList<>(); |
| | | Scanner scanner = new Scanner(new File("D:/iqiyi.txt")); |
| | | while (scanner.hasNextLine()) { |
| | | String line = scanner.nextLine(); |
| | | list.add(line.trim()); |
| | | } |
| | | scanner.close(); |
| | | for (int i = 25244; i < list.size(); i++) |
| | | try { |
| | | iqiyiUtil2.syncByAid(Long.parseLong(list.get(i)), true); |
| | | } catch (HibernateObjectRetrievalFailureException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void validSolrState() { |
| | | try { |
| | | iqiyi2Service.validAlbumSolrState(2928406697871201L); |
| | | } catch (IqiyiVideoSolrException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |