Skip to content

Commit

Permalink
Fixed extratorrent search not working Closes qbittorrent#5736 qbittor…
Browse files Browse the repository at this point in the history
…rent#5753

The original code accumulates all the <td> texts between the description
link and the number of seeders into self.current_item["size"]:
    <td>248.72</td><td>&nbsp;MB<td> => "248.72 MB".
ExtraTorrents changed the table design, added the Added column and joined
the number and its unit:
    <td>8d</td><td>248.72&nbsp;MB</td> => "8d 248.72 MB"
This commit stores only the last <td> text in self.current_item["size"].
  • Loading branch information
Yez Ezey committed Sep 22, 2016
1 parent 3ea81be commit 3a744a9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
6 changes: 2 additions & 4 deletions src/searchengine/nova/engines/extratorrent.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#VERSION: 2.04
#VERSION: 2.05
#AUTHORS: Christophe Dumez ([email protected])
#CONTRIBUTORS: Diego de las Heras ([email protected])

Expand Down Expand Up @@ -125,9 +125,7 @@ def handle_starttag(self, tag, attrs):

def handle_data(self, data):
if self.cur_item_name:
temp = self.current_item[self.cur_item_name]
self.current_item[self.cur_item_name] = " ".join((temp, data))
#Due to utf-8 we need to handle data two times if there is space
self.current_item[self.cur_item_name] = data
if not self.cur_item_name == "size":
self.cur_item_name = None

Expand Down
2 changes: 1 addition & 1 deletion src/searchengine/nova/engines/versions.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
demonoid: 1.21
extratorrent: 2.04
extratorrent: 2.05
legittorrents: 2.01
mininova: 2.02
piratebay: 2.15
Expand Down
6 changes: 2 additions & 4 deletions src/searchengine/nova3/engines/extratorrent.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#VERSION: 2.04
#VERSION: 2.05
#AUTHORS: Christophe Dumez ([email protected])
#CONTRIBUTORS: Diego de las Heras ([email protected])

Expand Down Expand Up @@ -125,9 +125,7 @@ def handle_starttag(self, tag, attrs):

def handle_data(self, data):
if self.cur_item_name:
temp = self.current_item[self.cur_item_name]
self.current_item[self.cur_item_name] = " ".join((temp, data))
#Due to utf-8 we need to handle data two times if there is space
self.current_item[self.cur_item_name] = data
if not self.cur_item_name == "size":
self.cur_item_name = None

Expand Down
2 changes: 1 addition & 1 deletion src/searchengine/nova3/engines/versions.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
demonoid: 1.21
extratorrent: 2.04
extratorrent: 2.05
legittorrents: 2.01
mininova: 2.02
piratebay: 2.15
Expand Down

0 comments on commit 3a744a9

Please sign in to comment.