diff --git a/dosagelib/scraper.py b/dosagelib/scraper.py index 9b0809ac9..2aabbdb67 100644 --- a/dosagelib/scraper.py +++ b/dosagelib/scraper.py @@ -2,6 +2,7 @@ # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2013 Bastian Kleineidam import requests +import time from . import loader from .util import fetchUrl, fetchUrls, getPageContent from .comic import ComicStrip @@ -41,6 +42,9 @@ class _BasicScraper(object): # usually the index format help help = '' + # wait time before downloading any pages or images + waitSeconds = 0 + # HTTP session storing cookies session = requests.session() @@ -133,6 +137,8 @@ class _BasicScraper(object): out.warn("Already seen previous URL %r" % prevUrl) break url = prevUrl + if self.waitSeconds: + time.sleep(self.waitSeconds) def getPrevUrl(self, url, data, baseUrl): """Find previous URL."""