Exemplo n.º 1
0
 def downloadLoop(self, title):
     db = DownloadDB()
     status = 'downloading'
     while db.get(title) and status != 'stopped':
         xbmc.sleep(3000)
         status = db.get_status(title)
         if not self.paused:
             if status == 'pause':
                 self.paused = True
                 self.session.pause()
         else:
             if status != 'pause':
                 self.paused = False
                 self.session.resume()
         s = self.torrentHandle.status()
         info = {}
         info['upload'] = s.upload_payload_rate
         info['download'] = s.download_payload_rate
         info['peers'] = s.num_peers
         info['seeds'] = s.num_seeds
         iterator = int(s.progress * 100)
         info['progress'] = iterator
         db.update(title, info)
         self.debug()
     self.session.remove_torrent(self.torrentHandle)
     return
Exemplo n.º 2
0
 def downloadLoop(self, title):
     db = DownloadDB()
     status = 'downloading'
     while db.get(title) and status != 'stopped':
         xbmc.sleep(3000)
         status = db.get_status(title)
         if not self.paused:
             if status == 'pause':
                 self.paused = True
                 self.session.pause()
         else:
             if status != 'pause':
                 self.paused = False
                 self.session.resume()
         s = self.torrentHandle.status()
         info = {}
         info['upload'] = s.upload_payload_rate
         info['download'] = s.download_payload_rate
         info['peers'] = s.num_peers
         info['seeds'] = s.num_seeds
         iterator = int(s.progress * 100)
         info['progress'] = iterator
         db.update(title, info)
         self.debug()
     self.session.remove_torrent(self.torrentHandle)
     return