diff --git a/macli.py b/macli.py index 9424aa2..3e2dcd0 100644 --- a/macli.py +++ b/macli.py @@ -76,8 +76,11 @@ def request(url): return urllib.request.urlopen(req) -def show_error(e): - print("\x1b[41;37m{}\x1b[0m") +def show_error(e, href=None): + print("\r\x1b[K\x1b[41;37m{}\x1b[0m".format(e)) + if href is not None: + print("Url: {}". format(href)) + def archive(content, base_url, selector, directory, attribute, progbar): @@ -102,7 +105,7 @@ def archive(content, base_url, selector, directory, attribute, progbar): try: content = request(href).read() except Exception as e: - show_error(e) + show_error(e, href) continue with open(path, 'wb') as f: