From b37275dba6b782bf3bb3817c4504f6cdef1bef7c Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 18 三月 2021 18:38:51 +0800
Subject: [PATCH] APP首页顶部标签兼容

---
 src/main/java/com/yeshi/buwan/job/JuHeVideoUpdateJob.java |  194 +++++++++++++-----------------------------------
 1 files changed, 52 insertions(+), 142 deletions(-)

diff --git a/src/main/java/com/yeshi/buwan/job/JuHeVideoUpdateJob.java b/src/main/java/com/yeshi/buwan/job/JuHeVideoUpdateJob.java
index efa0309..3dbab5c 100644
--- a/src/main/java/com/yeshi/buwan/job/JuHeVideoUpdateJob.java
+++ b/src/main/java/com/yeshi/buwan/job/JuHeVideoUpdateJob.java
@@ -23,156 +23,66 @@
 import com.yeshi.buwan.util.video.AcfunApiUtil;
 
 /**
- * 
- * 
  * @author Administrator
- *
  */
 @Component
 public class JuHeVideoUpdateJob {
-	@Resource
-	private IqiyiUtil iqiyiUtil;
-	@Resource
-	private SoHuUtil soHuUtil;
+    @Resource
+    private IqiyiUtil iqiyiUtil;
 
-	@Resource
-	private FunTVUtil funTVUtil;
+    @Resource
+    private IqiyiQueueService iqiyiQueueService;
 
-	@Resource
-	private AcFunUtil acFunUtil;
+    private static int c = 1;
 
-	@Resource
-	private IqiyiQueueService iqiyiQueueService;
+    public JuHeVideoUpdateJob() {
+        System.out.println("============================================瀹炰緥鍖栨鏁�:" + c);
+        ++c;
+    }
 
-	@Resource
-	private AcfunVideoNewService acfunVideoNewService;
+    // @Scheduled(cron = "0 25 17 * * ?")
+    // 鏆傛椂娉ㄩ噴鎺�
+    @Scheduled(cron = "0 0 0,9,14,20 * * ?")
+    public void doJob() {
+        if (!Constant.JobTasker)
+            return;
+        System.out.println("VideoUpdateJob-doJob");
+        new Thread(new Runnable() {
+            public void run() {
+                LogHelper.iqiyi("鏇存柊iaiyi銆傘�傘�傘�傘�傘��");
+                iqiyiUtil.updateAll("");
+            }
+        }).start();
+    }
 
-	private static int c = 1;
-
-	public JuHeVideoUpdateJob() {
-		System.out.println("============================================瀹炰緥鍖栨鏁�:" + c);
-		++c;
-	}
-
-	// @Scheduled(cron = "0 25 17 * * ?")
-	// 鏆傛椂娉ㄩ噴鎺�
-	@Scheduled(cron = "0 0 0,9,14,20 * * ?")
-	public void doJob() {
-		if (!Constant.JobTasker)
-			return;
-		System.out.println("VideoUpdateJob-doJob");
-		new Thread(new Runnable() {
-			public void run() {
-				LogHelper.iqiyi("鏇存柊iaiyi銆傘�傘�傘�傘�傘��");
-				iqiyiUtil.updateAll("");
-			}
-		}).start();
-
-		// new Thread(new Runnable() {
-		//
-		// public void run() {
-		// soHuUtil.parseAll();
-		// }
-		// }).start();
-
-		// new Thread(new Runnable() {
-		//
-		// public void run() {
-		// YouKuDJUtil.startParseUpdate();
-		// }
-		// }).start();
-		//
-		// new Thread(new Runnable() {
-		//
-		// public void run() {
-		// YouKuDJUtil.startParseDelete();
-		// }
-		// }).start();
-
-		// new Thread(new Runnable() {
-		//
-		// public void run() {
-		// pptvUtil.startParseTV();
-		// }
-		// }).start();
-		//
-		// new Thread(new Runnable() {
-		//
-		// public void run() {
-		// pptvUtil.startParseMovie();
-		// pptvUtil.startParseShow();
-		// pptvUtil.startParseCartoon();
-		// pptvUtil.startParseShortVideo();
-		// }
-		// }).start();
-	}
-
-	@Scheduled(cron = "0 0 2 * * ?")
-	public void updateAcFun() {
-		if (!Constant.JobTasker)
-			return;
-
-		AcfunVideoResult result = AcfunApiUtil.videoList("");
-		while (result != null && result.pcursor != null && !result.pcursor.equalsIgnoreCase("no_more")) {
-			if (result.videoList != null) {
-				acfunVideoNewService.save(result.videoList);
-				for (AcfunVideoNew video : result.videoList)
-					try {
-						acFunUtil.addVideo(video);
-					} catch (Exception e) {
-					}
-			}
-			result = AcfunApiUtil.videoList(result.pcursor);
-		}
-	}
-
-	@Scheduled(cron = "0 0 3,4 * * ? ")
-	// @Scheduled(cron = "0 52 * * * ? ")
-	public void updateFuntvAll() {
-		if (!Constant.JobTasker)
-			return;
-		synchronized (funTVUtil) {
-			funTVUtil.startUpdate();
-		}
-	}
-
-	@Scheduled(cron = "0 0 0/1 * * ? ")
-	public void updateFuntv() {
-		if (!Constant.JobTasker)
-			return;
-		synchronized (funTVUtil) {
-			funTVUtil.startUpdate();
-		}
-	}
-
-	@Scheduled(cron = "0 5 0,12,20 * * ? ")
-	public void updateIqiyiQueue() {
-		if (!Constant.JobTasker)
-			return;
-		synchronized (iqiyiQueueService) {
-			List<IqiyiUpdateQueue> queueList = iqiyiQueueService.listUpdateQueue();
-			for (IqiyiUpdateQueue queue : queueList) {
-				String aid = null;
-				int count = 0;
-				while (StringUtil.isNullOrEmpty(aid) && count < 3) {
-					if (StringUtil.isNullOrEmpty(queue.getAid())) {
-						aid = IqiYiNewAPI.getAidByUrl(queue.getUrl());
-						count++;
-						try {
-							Thread.sleep(1000 * 2);
-						} catch (InterruptedException e) {
-							e.printStackTrace();
-						}
-					} else
-						aid = queue.getAid();
-				}
-				if (!StringUtil.isNullOrEmpty(aid)) {
-					queue.setAid(aid);
-					iqiyiQueueService.updateUpdateQueue(queue);
-					iqiyiUtil.updateAlbum(aid);
-				}
-			}
-		}
-	}
+    @Scheduled(cron = "0 5 0,12,20 * * ? ")
+    public void updateIqiyiQueue() {
+        if (!Constant.JobTasker)
+            return;
+        synchronized (iqiyiQueueService) {
+            List<IqiyiUpdateQueue> queueList = iqiyiQueueService.listUpdateQueue();
+            for (IqiyiUpdateQueue queue : queueList) {
+                String aid = null;
+                int count = 0;
+                while (StringUtil.isNullOrEmpty(aid) && count < 3) {
+                    if (StringUtil.isNullOrEmpty(queue.getAid())) {
+                        aid = IqiYiNewAPI.getAidByUrl(queue.getUrl());
+                        count++;
+                        try {
+                            Thread.sleep(1000 * 2);
+                        } catch (InterruptedException e) {
+                            e.printStackTrace();
+                        }
+                    } else
+                        aid = queue.getAid();
+                }
+                if (!StringUtil.isNullOrEmpty(aid)) {
+                    queue.setAid(aid);
+                    iqiyiQueueService.updateUpdateQueue(queue);
+                    iqiyiUtil.updateAlbum(aid);
+                }
+            }
+        }
+    }
 
 }

--
Gitblit v1.8.0