Skip to content

Commit 68850b4

Browse files
authored
ChanRipper: Add a delay before downloading videos to avoid rate limiting related to specifically videos (fixes #2049) (#2112)
1 parent 37c2881 commit 68850b4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/com/rarchives/ripme/ripper/rippers/ChanRipper.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,16 @@ public List<String> getURLsFromPage(Document page) throws URISyntaxException {
279279
return imageURLs;
280280
}
281281

282+
private boolean isVideo(URL url) {
283+
String urlString = url.toExternalForm();
284+
return urlString.endsWith(".webm") || urlString.endsWith(".mp4");
285+
}
286+
282287
@Override
283288
public void downloadURL(URL url, int index) {
289+
if (isVideo(url)) {
290+
sleep(5000);
291+
}
284292
addURLToDownload(url, getPrefix(index));
285293
}
286294
}

0 commit comments

Comments
 (0)