| | |
| | | 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; |
| | | |
| | |
| | | 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"); |
| | |
| | | } |
| | | |
| | | 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)); |