command 'getfile' to store torrent in a file (or to stdout with '-')

This commit is contained in:
Romain Bignon 2010-05-02 19:09:31 +02:00
commit 550fee93ba
3 changed files with 38 additions and 3 deletions

View file

@ -53,5 +53,12 @@ class GazelleBackend(BaseBackend, ICapTorrent):
def get_torrent(self, id):
return self.browser.get_torrent(id)
def get_torrent_file(self, id):
torrent = self.browser.get_torrent(id)
if not torrent:
return None
return self.browser.openurl(torrent.url).read()
def iter_torrents(self, pattern):
return self.browser.iter_torrents(pattern)