mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
[search engine] Fix Python 2 implementation of Torrentz
This commit is contained in:
parent
d0b54b0797
commit
ee44fd54b6
@ -1,4 +1,4 @@
|
|||||||
#VERSION: 2.15
|
#VERSION: 2.16
|
||||||
#AUTHORS: Diego de las Heras (diegodelasheras@gmail.com)
|
#AUTHORS: Diego de las Heras (diegodelasheras@gmail.com)
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -95,6 +95,7 @@ class torrentz(object):
|
|||||||
if self.current_item['name'].find(' \xc2'):
|
if self.current_item['name'].find(' \xc2'):
|
||||||
self.current_item['name'] = self.current_item['name'].split(' \xc2')[0]
|
self.current_item['name'] = self.current_item['name'].split(' \xc2')[0]
|
||||||
self.current_item['link'] += '&' + urlencode({'dn' : self.current_item['name']})
|
self.current_item['link'] += '&' + urlencode({'dn' : self.current_item['name']})
|
||||||
|
self.current_item['name'] = self.current_item['name'].decode('utf8')
|
||||||
|
|
||||||
prettyPrinter(self.current_item)
|
prettyPrinter(self.current_item)
|
||||||
self.results.append('a')
|
self.results.append('a')
|
||||||
@ -106,14 +107,15 @@ class torrentz(object):
|
|||||||
# initialize trackers for magnet links
|
# initialize trackers for magnet links
|
||||||
trackers = '&' + '&'.join(urlencode({'tr' : tracker}) for tracker in self.trackers_list)
|
trackers = '&' + '&'.join(urlencode({'tr' : tracker}) for tracker in self.trackers_list)
|
||||||
|
|
||||||
|
results_list = []
|
||||||
|
parser = self.MyHtmlParser(results_list, self.url, trackers)
|
||||||
i = 0
|
i = 0
|
||||||
while i < 6:
|
while i < 6:
|
||||||
results_list = []
|
|
||||||
# "what" is already urlencoded
|
# "what" is already urlencoded
|
||||||
html = retrieve_url('%s/any?f=%s&p=%d' % (self.url, what, i))
|
html = retrieve_url(self.url + '/any?f=%s&p=%d' % (what, i))
|
||||||
parser = self.MyHtmlParser(results_list, self.url, trackers)
|
|
||||||
parser.feed(html)
|
parser.feed(html)
|
||||||
parser.close()
|
|
||||||
if len(results_list) < 1:
|
if len(results_list) < 1:
|
||||||
break
|
break
|
||||||
|
del results_list[:]
|
||||||
i += 1
|
i += 1
|
||||||
|
parser.close()
|
||||||
|
@ -6,4 +6,4 @@ legittorrents: 2.00
|
|||||||
mininova: 2.00
|
mininova: 2.00
|
||||||
piratebay: 2.11
|
piratebay: 2.11
|
||||||
torrentreactor: 1.40
|
torrentreactor: 1.40
|
||||||
torrentz: 2.15
|
torrentz: 2.16
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#VERSION: 2.15
|
#VERSION: 2.16
|
||||||
#AUTHORS: Diego de las Heras (diegodelasheras@gmail.com)
|
#AUTHORS: Diego de las Heras (diegodelasheras@gmail.com)
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -106,14 +106,15 @@ class torrentz(object):
|
|||||||
# initialize trackers for magnet links
|
# initialize trackers for magnet links
|
||||||
trackers = '&' + '&'.join(urlencode({'tr' : tracker}) for tracker in self.trackers_list)
|
trackers = '&' + '&'.join(urlencode({'tr' : tracker}) for tracker in self.trackers_list)
|
||||||
|
|
||||||
|
results_list = []
|
||||||
|
parser = self.MyHtmlParser(results_list, self.url, trackers)
|
||||||
i = 0
|
i = 0
|
||||||
while i < 6:
|
while i < 6:
|
||||||
results_list = []
|
|
||||||
# "what" is already urlencoded
|
# "what" is already urlencoded
|
||||||
html = retrieve_url(self.url + '/any?f=%s&p=%d' % (what, i))
|
html = retrieve_url(self.url + '/any?f=%s&p=%d' % (what, i))
|
||||||
parser = self.MyHtmlParser(results_list, self.url, trackers)
|
|
||||||
parser.feed(html)
|
parser.feed(html)
|
||||||
parser.close()
|
|
||||||
if len(results_list) < 1:
|
if len(results_list) < 1:
|
||||||
break
|
break
|
||||||
|
del results_list[:]
|
||||||
i += 1
|
i += 1
|
||||||
|
parser.close()
|
||||||
|
@ -6,4 +6,4 @@ legittorrents: 2.00
|
|||||||
mininova: 2.00
|
mininova: 2.00
|
||||||
piratebay: 2.11
|
piratebay: 2.11
|
||||||
torrentreactor: 1.40
|
torrentreactor: 1.40
|
||||||
torrentz: 2.15
|
torrentz: 2.16
|
||||||
|
Loading…
Reference in New Issue
Block a user