mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3: Fix login checks in various recipes
This commit is contained in:
parent
1de94d39e2
commit
96a8aeaaf5
@ -68,7 +68,7 @@ class DiscoverMagazine(BasicNewsRecipe):
|
||||
res = br.open('http://discovermagazine.com')
|
||||
br.set_debug_http(False)
|
||||
raw = res.read()
|
||||
if '>Logout<' not in raw:
|
||||
if b'>Logout<' not in raw:
|
||||
raise ValueError('Failed to login')
|
||||
return br
|
||||
|
||||
|
@ -29,7 +29,7 @@ class insider(BasicNewsRecipe):
|
||||
br['login-password'] = self.password
|
||||
res = br.submit()
|
||||
raw = res.read()
|
||||
if u'Odhlásit se' not in raw:
|
||||
if b'Odhlásit se' not in raw:
|
||||
raise ValueError('Failed to login to insider.cz'
|
||||
'Check your username and password.')
|
||||
return br
|
||||
|
@ -42,7 +42,7 @@ class JASN(BasicNewsRecipe):
|
||||
br['code'] = self.password
|
||||
response = br.submit()
|
||||
raw = response.read()
|
||||
if 'Sign Out' not in raw:
|
||||
if b'Sign Out' not in raw:
|
||||
raise ValueError('Failed to log in, is your account expired?')
|
||||
return br
|
||||
|
||||
|
@ -33,7 +33,7 @@ class LeTemps(BasicNewsRecipe):
|
||||
br['name'] = self.username
|
||||
br['pass'] = self.password
|
||||
raw = br.submit().read()
|
||||
if 'href="/subscribe"' in raw:
|
||||
if b'href="/subscribe"' in raw:
|
||||
raise ValueError(
|
||||
'Failed to login to letemps.ch. Check '
|
||||
'your username and password'
|
||||
|
@ -75,7 +75,7 @@ class DailyTelegraph(BasicNewsRecipe):
|
||||
br['username'] = self.username
|
||||
br['password'] = self.password
|
||||
raw = br.submit().read()
|
||||
if '>log out' not in raw.lower():
|
||||
if b'>log out' not in raw.lower():
|
||||
raise ValueError('Failed to log in to www.heralsun'
|
||||
' are your username and password correct?')
|
||||
return br
|
||||
|
@ -41,7 +41,7 @@ class NRCNext(BasicNewsRecipe):
|
||||
br['password'] = self.password
|
||||
response2 = br.submit()
|
||||
raw = response2.get_data()
|
||||
if 'niet ingelogd' in raw: # in body class
|
||||
if b'niet ingelogd' in raw: # in body class
|
||||
raise ValueError('Failed to login, check username and password')
|
||||
epubraw = None
|
||||
for today in (date.today(), date.today() - timedelta(days=1),):
|
||||
|
@ -32,7 +32,7 @@ class TNR(BasicNewsRecipe):
|
||||
br['pass'] = self.password
|
||||
self.log('Logging in...')
|
||||
raw = br.submit().read()
|
||||
if 'SIGN OUT' not in raw:
|
||||
if b'SIGN OUT' not in raw:
|
||||
raise ValueError(
|
||||
'Failed to log in to tnr.com, check your username and password')
|
||||
self.log('Logged in successfully')
|
||||
|
Loading…
x
Reference in New Issue
Block a user