Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chliny committed Oct 5, 2013
1 parent 8cc31a0 commit cc3f4a0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions xfdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,24 @@ def __pushtor(self,url):
defaultchose = []
totalsize = 0
for fileentry in torinfo["files"]:
totalsize += fileentry["file_size_ori"]
try:
totalsize += fileentry["file_size_ori"]
except:
print ("torrent error!")
return False

aversize = totalsize / len(torinfo["files"])
_print ("序号\t大小\t文件名")
for fileentry in torinfo["files"]:
name = fileentry["file_name"]
size = fileentry["file_size"]
index = fileentry["file_index"]
_print ("%d\t%s\t%s" % (index,size,name))
try:
_print ("%d\t%s\t%s" % (index,size,name))
except:
print ("torrent error")
return False

if fileentry["file_size_ori"] >= aversize:
defaultchose.append(str(index))

Expand Down

0 comments on commit cc3f4a0

Please # to comment.