mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 10:31:29 +00:00
Fix token caching
Authored by: bashonly
This commit is contained in:
parent
2c7a1dc392
commit
fca99e1433
|
@ -45,9 +45,9 @@ def _set_tokens(self, auth_data):
|
|||
ShoutTVBaseIE._REFRESH_TOKEN = refresh_token # 2 month TTL
|
||||
username, _ = self._get_login_info()
|
||||
if username and ShoutTVBaseIE._is_logged_in:
|
||||
self.cache.store(self._NETRC_MACHINE, 'tokens', {
|
||||
username: [ShoutTVBaseIE._ACCESS_TOKEN, ShoutTVBaseIE._REFRESH_TOKEN],
|
||||
})
|
||||
tokens = self.cache.load(self._NETRC_MACHINE, 'tokens', default={})
|
||||
tokens[username] = [ShoutTVBaseIE._ACCESS_TOKEN, ShoutTVBaseIE._REFRESH_TOKEN]
|
||||
self.cache.store(self._NETRC_MACHINE, 'tokens', tokens)
|
||||
|
||||
def _fetch_access_token(self, content_id=None):
|
||||
if ShoutTVBaseIE._ACCESS_TOKEN and ShoutTVBaseIE._ACCESS_EXPIRY - 10 > time.time():
|
||||
|
|
Loading…
Reference in a new issue