diff -r 497b7290977d -r df862cca1773 utility.py --- a/utility.py Sun Aug 16 19:27:14 2015 +0300 +++ b/utility.py Sun Aug 16 23:30:11 2015 +0300 @@ -51,8 +51,13 @@ return link -def read_url (url): - data = urllib.request.urlopen (urllib.request.Request (url)).read() +def read_url (url, timeout=None): + args = [urllib.request.Request (url), None] + + if timeout: + args += [timeout] + + data = urllib.request.urlopen (*args).read() return data.decode ('utf-8') def make_progress_bar (p, barLength, colored=True):