diff --git a/weboob/applications/weboorrents/weboorrents.py b/weboob/applications/weboorrents/weboorrents.py index b1f4e54c..3c748dcf 100644 --- a/weboob/applications/weboorrents/weboorrents.py +++ b/weboob/applications/weboorrents/weboorrents.py @@ -127,16 +127,19 @@ class Weboorrents(ReplApplication): def do_getfile(self, line): """ - getfile ID FILENAME + getfile ID [FILENAME] Get the .torrent file. FILENAME is where to write the file. If FILENAME is '-', the file is written to stdout. """ - id, dest = self.parse_command_args(line, 2, 2) + id, dest = self.parse_command_args(line, 2, 1) _id, backend_name = self.parse_id(id) + if dest is None: + dest = '%s.torrent' % _id + for backend, buf in self.do('get_torrent_file', _id, backends=backend_name): if buf: if dest == '-':