1
0
mirror of https://github.com/vikstrous/pirate-get synced 2025-04-11 00:08:38 +02:00

Fixed regex to match integer sizes

This commit is contained in:
repic 2013-11-12 11:33:32 +01:00
parent 9020c0b7a7
commit a3e875cf07

View File

@ -68,8 +68,9 @@ def main():
found = re.findall(""""(magnet\:\?xt=[^"]*)|<td align="right">([^<]+)</td>""", res)
# get sizes as well and substitute the &nbsp; character
sizes = [ match.replace("&nbsp;", " ") for match in re.findall("(?<=Size )[0-9]+\.[0-9]+\&nbsp\;[KMGT]iB",res) ]
# print res
sizes = [ match.replace("&nbsp;", " ") for match in re.findall("(?<=Size )[0-9.]+\&nbsp\;[KMGT]iB",res) ]
# print sizes
state = "seeds"
curr = ['',0,0] #magnet, seeds, leeches
for f in found: