Disable HBR recipes

This commit is contained in:
Kovid Goyal 2011-08-28 01:07:41 -06:00
parent 78bfecccda
commit 03ee341892
2 changed files with 14 additions and 3 deletions

View File

@ -11,9 +11,14 @@ class HBR(BasicNewsRecipe):
timefmt = ' [%B %Y]'
language = 'en'
no_stylesheets = True
recipe_disabled = ('hbr.org has started requiring the use of javascript'
' to log into their website. This is unsupported in calibre, so'
' this recipe has been disabled. If you would like to see '
' HBR supported in calibre, contact hbr.org and ask them'
' to provide a javascript free login method.')
LOGIN_URL = 'http://hbr.org/login?request_url=/'
LOGOUT_URL = 'http://hbr.org/logout?request_url=/'
LOGIN_URL = 'https://hbr.org/login?request_url=/'
LOGOUT_URL = 'https://hbr.org/logout?request_url=/'
INDEX = 'http://hbr.org/archive-toc/BR'
@ -44,7 +49,8 @@ class HBR(BasicNewsRecipe):
br['signin-form:username'] = self.username
br['signin-form:password'] = self.password
raw = br.submit().read()
if 'My Account' not in raw:
open('/t/crap.html', 'wb').write(raw)
if '>Sign out<' not in raw:
raise Exception('Failed to login, are you sure your username and password are correct?')
try:
link = br.find_link(text='Sign out')

View File

@ -9,6 +9,11 @@ class HBR(BasicNewsRecipe):
__author__ = 'Kovid Goyal'
language = 'en'
no_stylesheets = True
recipe_disabled = ('hbr.org has started requiring the use of javascript'
' to log into their website. This is unsupported in calibre, so'
' this recipe has been disabled. If you would like to see '
' HBR supported in calibre, contact hbr.org and ask them'
' to provide a javascript free login method.')
LOGIN_URL = 'http://hbr.org/login?request_url=/'
LOGOUT_URL = 'http://hbr.org/logout?request_url=/'