isohunt 69,99%
This commit is contained in:
parent
a40cf0ef44
commit
55174e4538
2 changed files with 23 additions and 23 deletions
|
|
@ -31,7 +31,7 @@ class IsohuntBrowser(BaseBrowser):
|
||||||
USER_AGENT = BaseBrowser.USER_AGENTS['wget']
|
USER_AGENT = BaseBrowser.USER_AGENTS['wget']
|
||||||
PAGES = {
|
PAGES = {
|
||||||
'https://isohunt.com/torrents/.*iht=-1&ihp=1&ihs1=2&iho1=d' : TorrentsPage,
|
'https://isohunt.com/torrents/.*iht=-1&ihp=1&ihs1=2&iho1=d' : TorrentsPage,
|
||||||
'http://isohunt.com/torrent_details.*tab=summary' : TorrentPage
|
'https://isohunt.com/torrent_details.*tab=summary' : TorrentPage
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ class TorrentsPage(BasePage):
|
||||||
|
|
||||||
for tr in self.document.getiterator('tr'):
|
for tr in self.document.getiterator('tr'):
|
||||||
if tr.attrib.get('class','') == 'hlRow':
|
if tr.attrib.get('class','') == 'hlRow':
|
||||||
|
# TODO à corriger
|
||||||
atitle = tr.getchildren()[2].getchildren()[1]
|
atitle = tr.getchildren()[2].getchildren()[1]
|
||||||
title = atitle.text
|
title = atitle.text
|
||||||
if not title:
|
if not title:
|
||||||
|
|
@ -75,37 +76,36 @@ class TorrentPage(BasePage):
|
||||||
return float(n*m[u])
|
return float(n*m[u])
|
||||||
|
|
||||||
def get_torrent(self, id):
|
def get_torrent(self, id):
|
||||||
url = 'https://isohunt.com/download/%s/mon_joli_torrent.torrent' % id
|
title = ''
|
||||||
|
description = 'No description'
|
||||||
|
url = 'https://isohunt.com/download/%s/%s.torrent' % (id , id)
|
||||||
for a in self.document.getiterator('a'):
|
for a in self.document.getiterator('a'):
|
||||||
if 'Search more torrents of' in a.attrib.get('title',''):
|
if 'Search more torrents of' in a.attrib.get('title',''):
|
||||||
title = a.tail
|
title = a.tail
|
||||||
#--------------------------TODO
|
|
||||||
|
|
||||||
description = "No description"
|
|
||||||
for div in self.document.getiterator('div'):
|
|
||||||
if div.attrib.get('id','') == 'desc':
|
|
||||||
description = div.text.strip()
|
|
||||||
for td in self.document.getiterator('td'):
|
|
||||||
if td.attrib.get('class','') == 'hreview-aggregate':
|
|
||||||
seed = int(td.getchildren()[2].getchildren()[0].getchildren()[0].text)
|
|
||||||
leech = int(td.getchildren()[2].getchildren()[1].getchildren()[0].text)
|
|
||||||
url = td.getchildren()[3].getchildren()[0].attrib.get('href')
|
|
||||||
title = td.getchildren()[1].getchildren()[0].getchildren()[0].text
|
|
||||||
|
|
||||||
size = 0
|
|
||||||
for span in self.document.getiterator('span'):
|
for span in self.document.getiterator('span'):
|
||||||
if span.attrib.get('class','') == "folder" or span.attrib.get('class','') == "folderopen":
|
if span.attrib.get('style','') == 'color:green;' and ('ShowTip' in span.attrib.get('onmouseover','')):
|
||||||
size = span.getchildren()[1].tail
|
seed = span.tail.split(' ')[1]
|
||||||
u = size.split(' ')[-1].split(')')[0]
|
break
|
||||||
size = float(size.split(': ')[1].split(' ')[0].replace(',','.'))
|
leech = 0
|
||||||
|
for p in self.document.getiterator('p'):
|
||||||
|
if p.attrib.get('style','') == "line-height:1.2em;margin-top:1.8em":
|
||||||
|
description = p.getchildren()[1].tail
|
||||||
|
break
|
||||||
|
# TODO marche pas
|
||||||
files = []
|
files = []
|
||||||
for td in self.document.getiterator('td'):
|
for td in self.document.getiterator('td'):
|
||||||
if td.attrib.get('class','') == 'torFileName':
|
print td.attrib.get('class')
|
||||||
|
if td.attrib.get('class','') == 'fileRows':
|
||||||
files.append(td.text)
|
files.append(td.text)
|
||||||
|
|
||||||
|
# TODO leechers
|
||||||
|
|
||||||
|
|
||||||
|
size = 0
|
||||||
|
u = 'MB'
|
||||||
|
|
||||||
|
#--------------------------TODO
|
||||||
|
|
||||||
torrent = Torrent(id, title)
|
|
||||||
torrent = Torrent(id, title)
|
torrent = Torrent(id, title)
|
||||||
torrent.url = url
|
torrent.url = url
|
||||||
torrent.size = self.unit(size,u)
|
torrent.size = self.unit(size,u)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue