Skip to content

Commit

Permalink
Yes
Browse files Browse the repository at this point in the history
  • Loading branch information
narumii committed Sep 5, 2022
1 parent 9152c7f commit 3002e0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public void downloadImages() {
AtomicInteger index = new AtomicInteger();

jobs(pageAmount);

for (final Hitomi.HitomiFile file : hitomi.getFiles()) {
ExecutorHelper.limitSubmit(() -> {
try {
Expand All @@ -64,7 +63,6 @@ public void downloadImages() {
.header("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36")
.build();


try (Response response = SiteHelper.CLIENT.newCall(request).execute()) {
if (!response.isSuccessful())
throw new RuntimeException(String.format("%s (status=%s) | %s", url, response.code(), file));
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/cafe/ethyr/hentaidl/helper/FileHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static void saveImage(Path path, URLConnection connection) {
}

try (InputStream stream = connection.getInputStream()) {
Files.copy(stream, path, StandardCopyOption.REPLACE_EXISTING);
Files.copy(stream, path);
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand All @@ -71,7 +71,7 @@ public static void saveImage(Path path, InputStream inputStream) throws IOExcept
}

try (inputStream) {
Files.copy(inputStream, path, StandardCopyOption.REPLACE_EXISTING);
Files.copy(inputStream, path);
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit 3002e0c

Please sign in to comment.