def isMember(self,info_hash): if info_hash in self.cache: return self.cache[info_hash] else: tor = KTorrent.torrent(info_hash) ret = self.url in [fqdn(tracker) for tracker in tor.trackers()] self.cache[info_hash] = ret return ret
def torrentAdded(self, info_hash): tor = KTorrent.torrent(info_hash) trackers = tor.trackers() for tracker in trackers: if not tracker in self.tracker_map: self.addTracker(tracker) else: self.tracker_map[tracker].ref()
def torrentAdded(self,info_hash): tor = KTorrent.torrent(info_hash) trackers = tor.trackers() for tracker in trackers: hostname = fqdn(tracker) if not hostname in self.tracker_map: self.addTracker(hostname) else: self.tracker_map[hostname].ref()
def torrentRemoved(self,info_hash): tor = KTorrent.torrent(info_hash) trackers = tor.trackers() for tracker in trackers: if tracker in self.tracker_map: self.removeTracker(tracker)
def torrentRemoved(ih): tor = KTorrent.torrent(ih) KTorrent.log("torrentRemoved=%s" % tor.name())
#!/usr/bin/python import KTorrent import Kross def torrentAdded(ih): tor = KTorrent.torrent(ih) KTorrent.log("torrentAdded=%s" % tor.name()) def torrentRemoved(ih): tor = KTorrent.torrent(ih) KTorrent.log("torrentRemoved=%s" % tor.name()) KTorrent.connect("torrentAdded(const QString &)",torrentAdded) KTorrent.connect("torrentRemoved(const QString &)",torrentRemoved) tors = KTorrent.torrents() KTorrent.log("Num torrents : %i" % len(tors)) for t in tors: tor = KTorrent.torrent(t) KTorrent.log("Torrent %s = %s" % (t, tor.name())) for i in range(0,tor.numFiles()): KTorrent.log("File %i = %s" % (i,tor.filePath(i)))
def torrentAdded(self, ih): tor = KTorrent.torrent(ih) self.connectSignals(tor)
def torrentAdded(self,ih): tor = KTorrent.torrent(ih) self.connectSignals(tor)
def torrentAdded(self, ih): tor = KTorrent.torrent(ih) KTorrent.log("Torrent added %s" % tor.name()) tor.connect("finished(QObject* )", self.torrentFinished)
def torrentAdded(self, ih): tor = KTorrent.torrent(ih) KTorrent.log("Torrent added %s" % tor.name()) for tk in self.trackers: tor.addTracker(tk)
def torrentAdded(self,ih): tor = KTorrent.torrent(ih) KTorrent.log("Torrent added %s" % tor.name()) tor.connect("finished(QObject* )",self.torrentFinished) tor.connect("seedingAutoStopped(QObject* ,const QString & )",self.seedingAutoStopped)