diff --git a/src/main/java/net/lamgc/cgj/bot/RankingUpdateTimer.java b/src/main/java/net/lamgc/cgj/bot/RankingUpdateTimer.java index ed98c27..bb4a836 100644 --- a/src/main/java/net/lamgc/cgj/bot/RankingUpdateTimer.java +++ b/src/main/java/net/lamgc/cgj/bot/RankingUpdateTimer.java @@ -31,7 +31,7 @@ public class RankingUpdateTimer { cal.set(Calendar.DAY_OF_YEAR, cal.get(Calendar.DAY_OF_YEAR) + 1); } cal.set(Calendar.HOUR_OF_DAY, 12); - cal.set(Calendar.MINUTE, 10); + cal.set(Calendar.MINUTE, 30); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); diff --git a/src/main/java/net/lamgc/cgj/pixiv/PixivDownload.java b/src/main/java/net/lamgc/cgj/pixiv/PixivDownload.java index 2f1c74a..e0d1dee 100644 --- a/src/main/java/net/lamgc/cgj/pixiv/PixivDownload.java +++ b/src/main/java/net/lamgc/cgj/pixiv/PixivDownload.java @@ -299,6 +299,7 @@ public class PixivDownload { */ public List getRanking(PixivURL.RankingContentType contentType, PixivURL.RankingMode mode, Date time, int rankStart, int range) throws IOException { + Objects.requireNonNull(time); if(!Objects.requireNonNull(contentType).isSupportedMode(Objects.requireNonNull(mode))) { throw new IllegalArgumentException("ContentType不支持指定的RankingMode: ContentType: " + contentType.name() + ", Mode: " + mode.name()); } else if(rankStart <= 0) { @@ -322,7 +323,7 @@ public class PixivDownload { String responseBody = EntityUtils.toString(response.getEntity()); log.debug("ResponseBody: {}", responseBody); if(response.getStatusLine().getStatusCode() != 200) { - throw new IOException("Http Response Error: " + response.getStatusLine()); + throw new IOException("Http Response Error: '" + response.getStatusLine() + "', ResponseBody: '" + responseBody + '\''); } JsonArray resultArray = gson.fromJson(responseBody, JsonObject.class).getAsJsonArray("contents"); @@ -432,13 +433,14 @@ public class PixivDownload { THUMB_MINI } - - /** * 获取帐号所有的收藏插画,并以输入流形式提供 * @return 获取所有链接的InputStream, 请注意关闭InputStream * @throws IOException 当获取时发生异常则直接抛出 + * @deprecated 该方法可能会导致已经打开的InputStream超时, 使图片获取失败, + * 请直接使用{@linkplain #getCollectionAsInputStream(PageQuality, BiConsumer)} */ + @Deprecated public Set> getCollectionAsInputStream(PageQuality quality) throws IOException { HashSet> illustInputStreamSet = new HashSet<>(); getCollectionAsInputStream(quality, (link, inputStream) -> illustInputStreamSet.add(new AbstractMap.SimpleEntry<>(link, inputStream))); diff --git a/src/main/java/net/lamgc/cgj/pixiv/PixivURL.java b/src/main/java/net/lamgc/cgj/pixiv/PixivURL.java index 43ed259..0826a27 100644 --- a/src/main/java/net/lamgc/cgj/pixiv/PixivURL.java +++ b/src/main/java/net/lamgc/cgj/pixiv/PixivURL.java @@ -336,7 +336,7 @@ public class PixivURL { * @return 如果支持返回true */ public boolean isSupportedMode(RankingMode mode) { - return Arrays.binarySearch(supportedMode, mode) != -1; + return Arrays.binarySearch(supportedMode, mode) < 0; } }