mirror of
https://github.com/vikstrous/pirate-get
synced 2025-01-24 12:14:20 +01:00
Added "uploaded" column
This commit is contained in:
parent
a3e875cf07
commit
a8ea586347
@ -70,7 +70,9 @@ def main():
|
|||||||
# get sizes as well and substitute the character
|
# get sizes as well and substitute the character
|
||||||
# print res
|
# print res
|
||||||
sizes = [ match.replace(" ", " ") for match in re.findall("(?<=Size )[0-9.]+\ \;[KMGT]iB",res) ]
|
sizes = [ match.replace(" ", " ") for match in re.findall("(?<=Size )[0-9.]+\ \;[KMGT]iB",res) ]
|
||||||
|
uploaded = [ match.replace(" ", " ") for match in re.findall("(?<=Uploaded ).+(?=\, Size)",res) ]
|
||||||
# print sizes
|
# print sizes
|
||||||
|
# print uploaded
|
||||||
state = "seeds"
|
state = "seeds"
|
||||||
curr = ['',0,0] #magnet, seeds, leeches
|
curr = ['',0,0] #magnet, seeds, leeches
|
||||||
for f in found:
|
for f in found:
|
||||||
@ -90,17 +92,17 @@ def main():
|
|||||||
exit()
|
exit()
|
||||||
|
|
||||||
# return the sizes in a spearate list
|
# return the sizes in a spearate list
|
||||||
return res_l, sizes
|
return res_l, sizes, uploaded
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
if args.database:
|
if args.database:
|
||||||
mags = local(args)
|
mags = local(args)
|
||||||
else:
|
else:
|
||||||
mags, sizes = remote(args)
|
mags, sizes, uploaded = remote(args)
|
||||||
|
|
||||||
if mags and len(mags) > 0:
|
if mags and len(mags) > 0:
|
||||||
# enhanced print output with column titles
|
# enhanced print output with column titles
|
||||||
print "\n%-5s %-6s %-6s %-5s %-11s %s" % ( "LINK", "SEED", "LEECH", "RATIO", "SIZE", "NAME")
|
print "\n%-5s %-6s %-6s %-5s %-11s %-11s %s" % ( "LINK", "SEED", "LEECH", "RATIO", "SIZE", "UPLOAD", "NAME")
|
||||||
for m in range(len(mags)):
|
for m in range(len(mags)):
|
||||||
magnet = mags[m]
|
magnet = mags[m]
|
||||||
name = re.search("dn=([^\&]*)", magnet[0])
|
name = re.search("dn=([^\&]*)", magnet[0])
|
||||||
@ -112,7 +114,7 @@ def main():
|
|||||||
ratio = 0
|
ratio = 0
|
||||||
|
|
||||||
# enhanced print output with justified columns
|
# enhanced print output with justified columns
|
||||||
print "%-5s %-6s %-6s %5.1f %-11s %s" % (m, magnet[1], magnet[2], ratio ,sizes[m], urllib.unquote(name.group(1).encode('ascii')).decode('utf-8').replace("+", " ") )
|
print "%-5s %-6s %-6s %5.1f %-11s %-11s %s" % (m, magnet[1], magnet[2], ratio ,sizes[m], uploaded[m],urllib.unquote(name.group(1).encode('ascii')).decode('utf-8').replace("+", " ") )
|
||||||
|
|
||||||
try:
|
try:
|
||||||
l = raw_input("Select a link: ")
|
l = raw_input("Select a link: ")
|
||||||
|
Loading…
Reference in New Issue
Block a user