Ejemplo n.º 1
0
    def prepare_torrent_file(self, data_path):
        torrent_dir = DEFAULTS['torrent_dir']
        torrent_path = os.path.join(torrent_dir, "%s.torrent" % self.output_dir)

        if os.access( torrent_path, os.F_OK ):
            logger.info( "Torrent file has already been generated" )
        else:
            try:
                t = TorrentMetadata()
                t.private = True
                t.data_path = data_path
                t.trackers = [[ DEFAULTS['tracker'] ]]
                t.save(torrent_path)
            except IOError, e:
                logger.error( str(e) )
Ejemplo n.º 2
0
 def make_torrent(self, data_path, torrent_path):
     torrent = TorrentMetadata()
     torrent.data_path = data_path
     torrent.trackers = [["http://127.0.0.1:7000/tracker/uannounce"]]
     torrent.save(torrent_path)