1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-12-23 00:18:55 +00:00

refactor: extract common _is_jwt_token_expired to InfoExtractor

This commit is contained in:
Michaël De Boey
2025-03-06 15:38:53 +01:00
parent e67d786c7c
commit 0242090a86
11 changed files with 20 additions and 53 deletions

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