From a918a1f736ab2db75fd9e8ce7c2fed2b521d7df9 Mon Sep 17 00:00:00 2001 From: Bas Rieter Date: Sun, 19 Nov 2023 16:43:31 +0100 Subject: [PATCH] Fixed: Full logout if no session before trying again. --- channels/channel.nos/nos2010/chn_nos2010.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/channels/channel.nos/nos2010/chn_nos2010.py b/channels/channel.nos/nos2010/chn_nos2010.py index 1be95ad5..cb467c55 100644 --- a/channels/channel.nos/nos2010/chn_nos2010.py +++ b/channels/channel.nos/nos2010/chn_nos2010.py @@ -206,6 +206,11 @@ def __log_on(self, force_log_off=False): """ Makes sure that we are logged on. """ def log_out_npo(): + # Old cookies + UriHandler.delete_cookie(domain=".npostart.nl") + UriHandler.delete_cookie(domain=".npo.nl") + UriHandler.delete_cookie(domain="www.npostart.nl") + # New cookies UriHandler.delete_cookie(domain="id.npo.nl") UriHandler.delete_cookie(domain="npo.nl") AddonSettings.set_channel_setting(self, "previous_username", username, store=LOCAL) @@ -237,6 +242,8 @@ def log_out_npo(): if bool(profile.json) and expires > time.time(): return True + log_out_npo() + # Fetch a CSRF token data = UriHandler.open("https://npo.nl/start/api/auth/csrf", no_cache=True) csrf_token = JsonHelper(data).get_value("csrfToken")