mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Disable HBR recipes
This commit is contained in:
parent
78bfecccda
commit
03ee341892
@ -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')
|
||||
|
@ -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=/'
|
||||
|
Loading…
x
Reference in New Issue
Block a user