From 9e46c6c047db188b35cd7ea4b7b9dc2937ee0992 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Thu, 26 Mar 2009 20:14:05 +0000 Subject: [PATCH] - Should completly fix unicode problems for all search engines --- src/search_engine/engines/isohunt.py | 6 +++--- src/search_engine/engines/mininova.py | 6 ++---- src/search_engine/engines/piratebay.py | 6 +++--- src/search_engine/engines/torrentreactor.py | 7 +++---- src/search_engine/engines/versions.txt | 8 ++++---- src/search_engine/helpers.py | 2 +- src/search_engine/novaprinter.py | 2 ++ 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/search_engine/engines/isohunt.py b/src/search_engine/engines/isohunt.py index a02d306f8..90da20406 100644 --- a/src/search_engine/engines/isohunt.py +++ b/src/search_engine/engines/isohunt.py @@ -1,4 +1,4 @@ -#VERSION: 1.1 +#VERSION: 1.2 #AUTHORS: Christophe Dumez (chris@qbittorrent.org) # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,7 @@ from novaprinter import prettyPrinter import re -import urllib +from helpers import retrieve_url class isohunt(object): url = 'http://isohunt.com' @@ -37,7 +37,7 @@ class isohunt(object): i = 1 while True and i<11: res = 0 - dat = urllib.urlopen(self.url+'/torrents.php?ihq=%s&ihp=%s&ihs1=2&iho1=d'%(what,i)).read().decode('utf8', 'replace') + dat = retrieve_url(self.url+'/torrents.php?ihq=%s&ihp=%s&ihs1=2&iho1=d'%(what,i)) # I know it's not very readable, but the SGML parser feels in pain section_re = re.compile('(?s)id=link.*?.*?[^/]+).*?' diff --git a/src/search_engine/engines/mininova.py b/src/search_engine/engines/mininova.py index 400b155cd..7f19b559a 100644 --- a/src/search_engine/engines/mininova.py +++ b/src/search_engine/engines/mininova.py @@ -1,4 +1,4 @@ -#VERSION: 1.2 +#VERSION: 1.21 #AUTHORS: Fabien Devaux (fab@gnux.info) # Redistribution and use in source and binary forms, with or without @@ -64,14 +64,12 @@ class mininova(object): return ''.join([ get_text(n) for n in txt.childNodes]) page = 1 while True and page<11: - file = open('/home/chris/mytest.txt', 'w') - file.write(self.url+'/search/%s/seeds/%d'%(what, page)) - file.close() res = 0 dat = retrieve_url(self.url+'/search/%s/seeds/%d'%(what, page)) dat = re.sub("