admin
2021-08-27 8fee151ffae0c3818694b7318583814bf92663e2
src/main/java/com/yeshi/buwan/util/video/AcfunApiUtil.java
@@ -8,10 +8,8 @@
import java.util.Map;
import com.google.gson.Gson;
import com.yeshi.buwan.acFun.AcfunVideoNew;
import com.yeshi.buwan.acFun.AcfunVideoResult;
import com.yeshi.buwan.service.imp.juhe.AcfunVideoNewService;
import com.yeshi.buwan.util.BeanUtil;
import com.yeshi.buwan.videos.acFun.AcfunVideoNew;
import com.yeshi.buwan.videos.acFun.AcfunVideoResult;
import com.yeshi.buwan.util.HttpUtil;
import com.yeshi.buwan.util.StringUtil;
@@ -50,6 +48,7 @@
      params.put("pcursor", pcursor);
      params.put("count", "100");
      String result = baseRequest(url, params);
      System.out.println(result);
      JSONObject resultJSON = JSONObject.fromObject(result);
      if (resultJSON.optInt("code") == 0) {
         JSONObject data = resultJSON.optJSONObject("data");
@@ -91,18 +90,20 @@
   }
   public static void main(String[] args) {
      AcfunVideoNewService acfunVideoNewService = BeanUtil.getBean(AcfunVideoNewService.class);
      AcfunVideoResult result = videoList("");
      while (result != null && result.pcursor != null && !result.pcursor.equalsIgnoreCase("no_more")) {
         if (result.videoList != null)
            acfunVideoNewService.save(result.videoList);
         result = videoList(result.pcursor);
         try {
            Thread.sleep(2000);
         } catch (InterruptedException e) {
            e.printStackTrace();
         }
      }
//      AcfunVideoNewService acfunVideoNewService = BeanUtil.getBean(AcfunVideoNewService.class);
//      AcfunVideoResult result = videoList("");
//      while (result != null && result.pcursor != null && !result.pcursor.equalsIgnoreCase("no_more")) {
//         if (result.videoList != null)
//            acfunVideoNewService.save(result.videoList);
//         result = videoList(result.pcursor);
//         try {
//            Thread.sleep(2000);
//         } catch (InterruptedException e) {
//            e.printStackTrace();
//         }
//      }
      videoList("");
      // String[] sts = new String[] { "5xzzqkwh73r27gq", "5xzzknzyuvvd9vc" };
      // List<Boolean> list = listValid(Arrays.asList(sts));