Skip to content

Commit

Permalink
Update log and error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
minamotorin authored and LinqLover committed Jan 2, 2022
1 parent cc3498a commit 62a1b7c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions twint/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class TokenExpiryException(Exception):
def __init__(self, msg):
super().__init__(msg)


class RefreshTokenException(Exception):
def __init__(self, msg):
super().__init__(msg)


class Token:
def __init__(self, config):
Expand Down Expand Up @@ -88,7 +88,8 @@ def refresh(self):
res = self._session.send(req, allow_redirects=True, timeout=self._timeout)
match = re.search(r'{"guest_token":"(\d+)"}', res.text)
if match:
logme.debug('Found guest token in JSON')
self.config.Guest_token = str(match.group(1))
else:
self.config.Guest_token = None
raise RefreshTokenException('Could not find the Guest token in HTML')
raise RefreshTokenException('Could not find the Guest token in JSON')

0 comments on commit 62a1b7c

Please sign in to comment.