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
|
import re
|
||||||
from HTMLParser import HTMLParser
|
from HTMLParser import HTMLParser
|
||||||
import argparse
|
import argparse
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
|
||||||
# create a subclass and override the handler methods
|
# create a subclass and override the handler methods
|
||||||
@ -69,10 +70,10 @@ 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]*[i ]*B",res) ]
|
||||||
uploaded = [ match.replace(" ", " ") for match in re.findall("(?<=Uploaded ).+(?=\, Size)",res) ]
|
uploaded = [ match.replace(" ", " ") for match in re.findall("(?<=Uploaded ).+(?=\, Size)",res) ]
|
||||||
# print sizes
|
# pprint(sizes); print len(sizes)
|
||||||
# print uploaded
|
# pprint(uploaded); print len(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:
|
||||||
|
Loading…
Reference in New Issue
Block a user