[qcineoob] search by id
[qcookboob] undo previous modif on backends, exceptions are handled by app
This commit is contained in:
parent
95953d3217
commit
5e247db743
9 changed files with 90 additions and 31 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 = {'á': u'á',
|
|||
'à': u'à',
|
||||
'À': u'À',
|
||||
'â': u'â',
|
||||
'É': u'É',
|
||||
'ç': u'ç'
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue