From 82b9c77ff1406bb683d31ccdfee429583ddb19a7 Mon Sep 17 00:00:00 2001 From: Viktor Stanchev Date: Sun, 30 Aug 2015 22:54:59 -0700 Subject: [PATCH] fix bugs with saving magnets and torrents --- pirate/print.py | 2 +- pirate/torrent.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pirate/print.py b/pirate/print.py index c971e34..9d3f4a0 100644 --- a/pirate/print.py +++ b/pirate/print.py @@ -31,7 +31,7 @@ def print(*args, **kwargs): return builtins.print(*args, **kwargs) -def search_results(mags, sizes, uploaded, local): +def search_results(mags, sizes, uploaded, local=None): columns = int(os.popen('stty size', 'r').read().split()[1]) cur_color = 'zebra_0' diff --git a/pirate/torrent.py b/pirate/torrent.py index bdaff2d..6699b88 100644 --- a/pirate/torrent.py +++ b/pirate/torrent.py @@ -4,8 +4,10 @@ import gzip import urllib.request as request import urllib.parse as parse import urllib.error +import os.path import pirate.data +from pirate.print import print from io import BytesIO @@ -152,4 +154,4 @@ def save_magnets(chosen_links, mags, folder): print('Saved {:X} in {}'.format(info_hash, file)) with open(file, 'w') as f: - f.write(magnet + '\n') \ No newline at end of file + f.write(magnet + '\n')