From 7f165f67351027533dde6476d4bb8ecb0c45afa6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 18 Sep 2019 09:44:50 +0530 Subject: [PATCH] Make logout link detection a bit more robust Also fix typo in wsj_free recipe, it should match wsj --- recipes/wsj.recipe | 2 +- recipes/wsj_free.recipe | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/wsj.recipe b/recipes/wsj.recipe index e6fc4c6a42..fd1c6b32d9 100644 --- a/recipes/wsj.recipe +++ b/recipes/wsj.recipe @@ -148,7 +148,7 @@ class WSJ(BasicNewsRecipe): self.log('Performing login callback...') res = br.submit() self.wsj_itp_page = raw = res.read() - if b'logout' not in raw: + if b'/logout' not in raw: raise ValueError( 'Failed to login (callback URL failed), check username and password') return br diff --git a/recipes/wsj_free.recipe b/recipes/wsj_free.recipe index 393dead6aa..06b0312c1d 100644 --- a/recipes/wsj_free.recipe +++ b/recipes/wsj_free.recipe @@ -148,7 +148,7 @@ class WSJ(BasicNewsRecipe): self.log('Performing login callback...') res = br.submit() self.wsj_itp_page = raw = res.read() - if b'>logout<' not in raw: + if b'/logout' not in raw: raise ValueError( 'Failed to login (callback URL failed), check username and password') return br