From afb7236db96b3ad34b48c59777bcd649f9da3dcc Mon Sep 17 00:00:00 2001 From: 4pr0n Date: Sun, 11 Jan 2015 00:07:45 -0800 Subject: [PATCH] Sleep 2sec when fetching reddit pages --- .../com/rarchives/ripme/ripper/rippers/RedditRipper.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/RedditRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/RedditRipper.java index 7b5c82d1..3a234dac 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/RedditRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/RedditRipper.java @@ -96,6 +96,13 @@ public class RedditRipper extends AlbumRipper { nextURL = new URL(nextURLString); } } + + // Wait to avoid rate-limiting against reddit's API + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + logger.warn("Interrupted while sleeping", e); + } return nextURL; }