ой...
parent
ccd8fc386a
commit
6b0a1084ec
|
@ -323,13 +323,14 @@ class TorrentFS(object):
|
||||||
return bytes_
|
return bytes_
|
||||||
def __files_(self):
|
def __files_(self):
|
||||||
info = self.TorrentInfo()
|
info = self.TorrentInfo()
|
||||||
|
files_ = []
|
||||||
for i in range(info.num_files()):
|
for i in range(info.num_files()):
|
||||||
file_ = self.__file_at_(i)
|
file_ = self.__file_at_(i)
|
||||||
file_.downloaded = self.getFileDownloadedBytes(i)
|
file_.downloaded = self.getFileDownloadedBytes(i)
|
||||||
if file_.size > 0:
|
if file_.size > 0:
|
||||||
file_.progress = float(file_.downloaded)/float(file_.size)
|
file_.progress = float(file_.downloaded)/float(file_.size)
|
||||||
self.files.append(file_)
|
files_.append(file_)
|
||||||
return self.files
|
return files_
|
||||||
def __file_at_(self, index):
|
def __file_at_(self, index):
|
||||||
info = self.TorrentInfo()
|
info = self.TorrentInfo()
|
||||||
fileEntry = info.file_at(index)
|
fileEntry = info.file_at(index)
|
||||||
|
@ -643,7 +644,10 @@ class Pyrrent2http(object):
|
||||||
except:
|
except:
|
||||||
info = self.torrentHandle.get_torrent_info()
|
info = self.torrentHandle.get_torrent_info()
|
||||||
logging.info('Downloading torrent: %s' % (info.name(),))
|
logging.info('Downloading torrent: %s' % (info.name(),))
|
||||||
self.TorrentFS = TorrentFS(self, self.torrentHandle, self.config.fileIndex)
|
try:
|
||||||
|
self.TorrentFS = TorrentFS(self, self.torrentHandle, self.config.fileIndex)
|
||||||
|
except Exception as e:
|
||||||
|
logging.error(e.args)
|
||||||
|
|
||||||
def startHTTP(self):
|
def startHTTP(self):
|
||||||
#def http_server_loop(listener, alive):
|
#def http_server_loop(listener, alive):
|
||||||
|
|
Loading…
Reference in New Issue