fix piratebay small sizes
This commit is contained in:
parent
f0b7e14a01
commit
bd12ead317
1 changed files with 9 additions and 9 deletions
|
|
@ -26,11 +26,12 @@ __all__ = ['TorrentsPage']
|
||||||
|
|
||||||
class TorrentsPage(BasePage):
|
class TorrentsPage(BasePage):
|
||||||
def unit(self, n, u):
|
def unit(self, n, u):
|
||||||
m = {'KB': 1024,
|
m = {'B': 1,
|
||||||
'MB': 1024*1024,
|
'KB': 1024,
|
||||||
'GB': 1024*1024*1024,
|
'MB': 1024*1024,
|
||||||
'TB': 1024*1024*1024*1024,
|
'GB': 1024*1024*1024,
|
||||||
}
|
'TB': 1024*1024*1024*1024,
|
||||||
|
}
|
||||||
#return float(n.replace(',', '')) * m.get(u, 1)
|
#return float(n.replace(',', '')) * m.get(u, 1)
|
||||||
return float(n*m[u])
|
return float(n*m[u])
|
||||||
|
|
||||||
|
|
@ -51,10 +52,9 @@ class TorrentsPage(BasePage):
|
||||||
a = td.getchildren()[1]
|
a = td.getchildren()[1]
|
||||||
url = a.attrib['href']
|
url = a.attrib['href']
|
||||||
|
|
||||||
size = td.find('font').text.split(',')[1]
|
size = td.find('font').text.split(',')[1].strip()
|
||||||
size = size.split(' ')[2]
|
u = size.split(' ')[1].split(u'\xa0')[1].replace('i','')
|
||||||
u = size[-3:].replace('i','')
|
size = size.split(' ')[1].split(u'\xa0')[0]
|
||||||
size = size[:-3]
|
|
||||||
|
|
||||||
seed = tr.getchildren()[2].text
|
seed = tr.getchildren()[2].text
|
||||||
leech = tr.getchildren()[3].text
|
leech = tr.getchildren()[3].text
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue