[qcineoob] search by id

[qcookboob] undo previous modif on backends, exceptions  are handled by app
This commit is contained in:
Julien Veyssier 2013-03-17 18:19:07 +01:00
commit 5e247db743
9 changed files with 90 additions and 31 deletions

View file

@ -43,5 +43,5 @@ class BtmonBrowser(BaseBrowser):
def get_torrent(self, id):
self.location('http://www.btmon.com/%s.html' % id)
assert self.is_on_page(TorrentPage)
return self.page.get_torrent()
if self.is_on_page(TorrentPage):
return self.page.get_torrent()

View file

@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser import BaseBrowser, BrowserHTTPNotFound
from weboob.tools.browser import BaseBrowser
from .pages import RecipePage, ResultsPage
@ -43,11 +43,6 @@ class CuisineazBrowser(BaseBrowser):
return self.page.iter_recipes()
def get_recipe(self, id):
try:
self.location('http://www.cuisineaz.com/recettes/%s.aspx' % id)
except BrowserHTTPNotFound:
return
self.location('http://www.cuisineaz.com/recettes/%s.aspx' % id)
if self.is_on_page(RecipePage):
return self.page.get_recipe(id)
else:
return

View file

@ -75,7 +75,7 @@ class ImdbBrowser(BaseBrowser):
for cat in ['name_popular', 'name_exact', 'name_approx']:
if cat in jres:
for p in jres[cat]:
person = Person(p['id'], latin2unicode(p['name']))
person = Person(p['id'], latin2unicode(unicode(p['name'])))
person.real_name = NotLoaded
person.birth_place = NotLoaded
person.birth_date = NotLoaded
@ -218,6 +218,7 @@ dict_hex = {'&#xE1;': u'á',
'&#xE0;': u'à',
'&#xC0;': u'À',
'&#xE2;': u'â',
'&#xC9;': u'É',
'&#xE7;': u'ç'
}

View file

@ -46,5 +46,5 @@ class IsohuntBrowser(BaseBrowser):
def get_torrent(self, id):
self.location('https://isohunt.com/torrent_details/%s/?tab=summary' % id)
assert self.is_on_page(TorrentPage)
return self.page.get_torrent(id)
if self.is_on_page(TorrentPage):
return self.page.get_torrent(id)

View file

@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser import BaseBrowser, BrowserHTTPNotFound
from weboob.tools.browser import BaseBrowser
from .pages import RecipePage, ResultsPage
@ -42,11 +42,6 @@ class MarmitonBrowser(BaseBrowser):
return self.page.iter_recipes()
def get_recipe(self, id):
try:
self.location('http://www.marmiton.org/recettes/recette_%s.aspx' % id)
except BrowserHTTPNotFound:
return
self.location('http://www.marmiton.org/recettes/recette_%s.aspx' % id)
if self.is_on_page(RecipePage):
return self.page.get_recipe(id)
else:
return

View file

@ -49,9 +49,6 @@ class PiratebayBrowser(BaseBrowser):
return self.page.iter_torrents()
def get_torrent(self, id):
try:
self.location('https://thepiratebay.se/torrent/%s/' % id)
except:
return None
self.location('https://thepiratebay.se/torrent/%s/' % id)
assert self.is_on_page(TorrentPage)
return self.page.get_torrent(id)