Commit 93e778fc authored by Julien Veyssier's avatar Julien Veyssier Committed by Vincent A

[limetorrents] fix torrent url : remove parameters

parent 72f93666
......@@ -37,7 +37,7 @@ class SearchPage(HTMLPage):
class item(ItemElement):
klass = Torrent
def obj_url(self):
url = AbsoluteLink('.//div[has-class("tt-name")]/a[1]')(self)
url = Regexp(AbsoluteLink('.//div[has-class("tt-name")]/a[1]'), '(^.*)\?.*', '\\1')(self)
return url.replace('http://', 'https://')
obj_id = Regexp(CleanText('.//div[has-class("tt-name")]/a[2]/@href'), '/.*-torrent-([0-9]+)\.html$', '\\1')
obj_name = CleanText('.//div[has-class("tt-name")]/a[2]/text()')
......@@ -60,7 +60,7 @@ class TorrentPage(HTMLPage):
obj_name = CleanText('.//div[@id="content"]/h1')
obj_id = Regexp(CleanText('//div[@id="updatestatslink"]/a/@onclick'), 'torrent_id=([0-9]+)&', '\\1')
def obj_url(self):
url = AbsoluteLink('//div[has-class("torrentinfo")]//div[has-class("dltorrent")]//a[text()="Download torrent"]')(self)
url = Regexp(AbsoluteLink('//div[has-class("torrentinfo")]//div[has-class("dltorrent")]//a[text()="Download torrent"]'), '(^.*)\?.*', '\\1')(self)
return url.replace('http://', 'https://')
obj_filename = Format('%s.torrent', obj_name)
def obj_size(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment