1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-11 16:34:04 +02:00

ChanRipper: Add a delay before downloading videos to avoid rate limiting related to specifically videos (fixes #2049) (#2112)

This commit is contained in:
metaprime
2025-04-15 10:57:57 -07:00
committed by GitHub
parent 37c28817df
commit 68850b4465

View File

@@ -279,8 +279,16 @@ public class ChanRipper extends AbstractHTMLRipper {
return imageURLs;
}
private boolean isVideo(URL url) {
String urlString = url.toExternalForm();
return urlString.endsWith(".webm") || urlString.endsWith(".mp4");
}
@Override
public void downloadURL(URL url, int index) {
if (isVideo(url)) {
sleep(5000);
}
addURLToDownload(url, getPrefix(index));
}
}