mirror of
https://github.com/vikstrous/pirate-get
synced 2025-01-10 10:04:21 +01:00
Merge pull request #22 from stoneage7/master
-p option doesn't work for me
This commit is contained in:
commit
2ec57f7cd0
@ -85,6 +85,8 @@ def main():
|
||||
|
||||
# Catch the Ctrl-C exception and exit cleanly
|
||||
try:
|
||||
sizes = []
|
||||
uploaded = []
|
||||
for page in xrange(pages):
|
||||
request = urllib2.Request(mirror + '/search/' + args.q.replace(" ", "+") + '/' + str(page) + '/7/0')
|
||||
request.add_header('Accept-encoding', 'gzip')
|
||||
@ -104,8 +106,8 @@ def main():
|
||||
|
||||
# get sizes as well and substitute the character
|
||||
# print 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) ]
|
||||
sizes.extend([match.replace(" ", " ") for match in re.findall("(?<=Size )[0-9.]+\ \;[KMGT]*[i ]*B",res)])
|
||||
uploaded.extend([match.replace(" ", " ") for match in re.findall("(?<=Uploaded ).+(?=\, Size)",res)])
|
||||
# pprint(sizes); print len(sizes)
|
||||
# pprint(uploaded); print len(uploaded)
|
||||
state = "seeds"
|
||||
|
Loading…
Reference in New Issue
Block a user