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:
parent
36f1ee0cff
commit
25f29e7e30
@ -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(" ", " ") for match in re.findall("(?<=Size )[0-9.]+\ \;[KMGT]iB",res) ]
|
||||
sizes = [ match.replace(" ", " ") for match in re.findall("(?<=Size )[0-9.]+\ \;[KMGT]*[i ]*B",res) ]
|
||||
uploaded = [ match.replace(" ", " ") 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:
|
||||
|
Loading…
Reference in New Issue
Block a user