[cineoob] integration of ICapSubtitle, new command search_movie_subtitle
small corrections to attilasub
This commit is contained in:
parent
e37dd25f07
commit
501ff0d200
3 changed files with 129 additions and 5 deletions
|
|
@ -18,7 +18,7 @@
|
|||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from weboob.tools.browser import BaseBrowser
|
||||
from weboob.tools.browser import BaseBrowser, BrowserHTTPNotFound
|
||||
|
||||
from .pages import SubtitlesPage, SearchPage
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ __all__ = ['AttilasubBrowser']
|
|||
class AttilasubBrowser(BaseBrowser):
|
||||
DOMAIN = 'davidbillemont3.free.fr'
|
||||
PROTOCOL = 'http'
|
||||
ENCODING = 'utf-8'
|
||||
ENCODING = 'windows-1252'
|
||||
USER_AGENT = BaseBrowser.USER_AGENTS['wget']
|
||||
PAGES = {
|
||||
'http://search.freefind.com/find.html.*': SearchPage,
|
||||
|
|
@ -43,6 +43,9 @@ class AttilasubBrowser(BaseBrowser):
|
|||
|
||||
def get_subtitle(self, id):
|
||||
url_end = id.split('|')[0]
|
||||
self.location('http://davidbillemont3.free.fr/%s' % url_end)
|
||||
try:
|
||||
self.location('http://davidbillemont3.free.fr/%s' % url_end)
|
||||
except BrowserHTTPNotFound:
|
||||
return
|
||||
assert self.is_on_page(SubtitlesPage)
|
||||
return self.page.get_subtitle(id)
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class SubtitlesPage(BasePage):
|
|||
original_title = " ".join(original_title_words)
|
||||
|
||||
nb_cd = self.parser.select(cols[2],'font',1).text.strip()
|
||||
nb_cd = int(nb_cd.split()[0])
|
||||
nb_cd = int(nb_cd.strip(' CD'))
|
||||
name = "%s (%s)"%(original_title,traduced_title)
|
||||
href = self.parser.select(cols[3],'a',1).attrib.get('href','')
|
||||
url = "http://davidbillemont3.free.fr/%s"%href
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue