refactor: extract common _is_jwt_token_expired to InfoExtractor

This commit is contained in:
Michaël De Boey
2025-03-15 23:56:24 +01:00
parent e67d786c7c
commit 0242090a86
11 changed files with 20 additions and 53 deletions
+1 -3
View File
@@ -1,5 +1,3 @@
import time
from .wrestleuniverse import WrestleUniverseBaseIE
from ..utils import (
int_or_none,
@@ -22,7 +20,7 @@ class StacommuBaseIE(WrestleUniverseBaseIE):
@WrestleUniverseBaseIE._TOKEN.getter
def _TOKEN(self):
if self._REAL_TOKEN and self._TOKEN_EXPIRY <= int(time.time()):
if self._REAL_TOKEN and self._is_jwt_token_expired(self._REAL_TOKEN):
self._refresh_token()
return self._REAL_TOKEN