From 3074abf463a24e750f02bcf33507aabb9361a22b Mon Sep 17 00:00:00 2001 From: Augusto Morais Date: Fri, 14 Sep 2018 22:11:29 -0300 Subject: [PATCH 1/2] give more detail when there is not possible download a torrent file --- pirate/torrent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pirate/torrent.py b/pirate/torrent.py index 340618d..e5289a7 100644 --- a/pirate/torrent.py +++ b/pirate/torrent.py @@ -182,7 +182,8 @@ def save_torrents(printer, chosen_links, results, folder): try: torrent = get_torrent(info_hash) except urllib.error.HTTPError: - printer.print('There is no cached file for this torrent :(', + printer.print('There is no cached file for this torrent :(' + ' \nCode: {} - {}'.format(e.code, e.reason), color='ERROR') else: open(file, 'wb').write(torrent) From 651ee9747f553a809b0da24b290fae1ea75879a6 Mon Sep 17 00:00:00 2001 From: Augusto Morais Date: Fri, 14 Sep 2018 23:14:29 -0300 Subject: [PATCH 2/2] fix exception --- pirate/torrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pirate/torrent.py b/pirate/torrent.py index e5289a7..baf93a0 100644 --- a/pirate/torrent.py +++ b/pirate/torrent.py @@ -181,7 +181,7 @@ def save_torrents(printer, chosen_links, results, folder): try: torrent = get_torrent(info_hash) - except urllib.error.HTTPError: + except urllib.error.HTTPError as e: printer.print('There is no cached file for this torrent :(' ' \nCode: {} - {}'.format(e.code, e.reason), color='ERROR')