1
0
mirror of https://github.com/vikstrous/pirate-get synced 2025-01-10 10:04:21 +01:00

Sizes fix

Fixed the regular expression so that sizes in bytes (B) work properly.
This commit is contained in:
repic 2013-12-10 14:41:56 +01:00
parent 36f1ee0cff
commit 25f29e7e30

View File

@ -5,6 +5,7 @@ import urllib2
import re
from HTMLParser import HTMLParser
import argparse
from pprint import pprint
# create a subclass and override the handler methods
@ -69,10 +70,10 @@ def main():
# get sizes as well and substitute the   character
# print res
sizes = [ match.replace("&nbsp;", " ") for match in re.findall("(?<=Size )[0-9.]+\&nbsp\;[KMGT]iB",res) ]
sizes = [ match.replace("&nbsp;", " ") for match in re.findall("(?<=Size )[0-9.]+\&nbsp\;[KMGT]*[i ]*B",res) ]
uploaded = [ match.replace("&nbsp;", " ") for match in re.findall("(?<=Uploaded ).+(?=\, Size)",res) ]
# print sizes
# print uploaded
# pprint(sizes); print len(sizes)
# pprint(uploaded); print len(uploaded)
state = "seeds"
curr = ['',0,0] #magnet, seeds, leeches
for f in found: