|
@@ -45,7 +45,6 @@ public class KuaishouAppServiceImpl implements IKuaishouAppService {
|
|
public void adFetch(KuaishouAppAccount kuaishouAppAccount, Integer page) {
|
|
public void adFetch(KuaishouAppAccount kuaishouAppAccount, Integer page) {
|
|
String videoFeeds = kuaishouCrawlerService.getVideoFeeds(kuaishouAppAccount, page);
|
|
String videoFeeds = kuaishouCrawlerService.getVideoFeeds(kuaishouAppAccount, page);
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
- int i = 0;
|
|
|
|
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
|
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
|
try {
|
|
try {
|
|
AppResult appResult = mapper.readValue(videoFeeds, new TypeReference<AppResult>() {
|
|
AppResult appResult = mapper.readValue(videoFeeds, new TypeReference<AppResult>() {
|
|
@@ -81,7 +80,6 @@ public class KuaishouAppServiceImpl implements IKuaishouAppService {
|
|
ad.setAppName(ad.getAppName().replace(".apk","").replace(".APK","").replace("ios","").replace("IOS",""));
|
|
ad.setAppName(ad.getAppName().replace(".apk","").replace(".APK","").replace("ios","").replace("IOS",""));
|
|
System.out.println(ad.getAdCover());
|
|
System.out.println(ad.getAdCover());
|
|
appAdService.saveOrUpdate(ad);
|
|
appAdService.saveOrUpdate(ad);
|
|
- i++;
|
|
|
|
try {
|
|
try {
|
|
KuaishouAdAccount kuaishouAdAccount = kuaishouAdAccountService.getById(ad.getUserId());
|
|
KuaishouAdAccount kuaishouAdAccount = kuaishouAdAccountService.getById(ad.getUserId());
|
|
if (kuaishouAdAccount == null) {
|
|
if (kuaishouAdAccount == null) {
|
|
@@ -98,10 +96,6 @@ public class KuaishouAppServiceImpl implements IKuaishouAppService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- log.info("account:{} 抓取数据个数:{}", kuaishouAppAccount.getId(), i);
|
|
|
|
- if (i == 0) {
|
|
|
|
- log.info("accountId:{};返回数据:{}", kuaishouAppAccount.getId(), videoFeeds);
|
|
|
|
- }
|
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
@@ -153,7 +147,6 @@ public class KuaishouAppServiceImpl implements IKuaishouAppService {
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
|
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
|
try {
|
|
try {
|
|
- int i = 0;
|
|
|
|
AppResult appResult = mapper.readValue(videoFeeds, new TypeReference<AppResult>() {
|
|
AppResult appResult = mapper.readValue(videoFeeds, new TypeReference<AppResult>() {
|
|
});
|
|
});
|
|
if (appResult != null && appResult.getFeeds() != null) {
|
|
if (appResult != null && appResult.getFeeds() != null) {
|
|
@@ -202,10 +195,6 @@ public class KuaishouAppServiceImpl implements IKuaishouAppService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- log.info("account:{} 抓取数据个数:{}", kuaishouIosAccount.getId(), i);
|
|
|
|
- if (i == 0) {
|
|
|
|
- log.info("accountId:{};返回数据:{}", kuaishouIosAccount.getId(), videoFeeds);
|
|
|
|
- }
|
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|