mirror of
https://github.com/beetbox/beets.git
synced 2026-02-23 07:44:38 +01:00
re-query token when it has expired
This commit is contained in:
parent
56d7e5dfa0
commit
05970e8a93
1 changed files with 3 additions and 0 deletions
|
|
@ -721,6 +721,9 @@ class LyricsPlugin(plugins.BeetsPlugin):
|
|||
if r.status_code != 200:
|
||||
self._log.debug('translation API error {}: {}', r.status_code,
|
||||
r.text)
|
||||
if 'token has expired' in r.text:
|
||||
self.bing_auth_token = None
|
||||
return self.append_translation(text, to_lang)
|
||||
return text
|
||||
lines_translated = ET.fromstring(r.text.encode('utf8')).text
|
||||
# Use a translation mapping dict to build resulting lyrics
|
||||
|
|
|
|||
Loading…
Reference in a new issue