move _jwt_is_expired to utils

This commit is contained in:
Michaël De Boey
2025-03-16 23:40:50 +01:00
parent 98a68be9b8
commit 1b1117a9c5
12 changed files with 32 additions and 22 deletions
+3 -2
View File
@@ -11,6 +11,7 @@ from ..utils import (
float_or_none,
int_or_none,
js_to_json,
jwt_is_expired,
mimetype2ext,
orderedSet,
parse_age_limit,
@@ -653,7 +654,7 @@ class CBCGemIE(CBCGemBaseIE):
raise
def _fetch_access_token(self):
if self._jwt_is_expired(self._access_token):
if jwt_is_expired(self._access_token):
try:
self._call_oauth_api({
'grant_type': 'refresh_token',
@@ -671,7 +672,7 @@ class CBCGemIE(CBCGemBaseIE):
if not self._get_login_info()[0]:
return None
if not self._claims_token or self._jwt_is_expired(self._claims_token):
if not self._claims_token or jwt_is_expired(self._claims_token):
self._claims_token = self._download_json(
'https://services.radio-canada.ca/ott/subscription/v2/gem/Subscriber/profile',
None, 'Downloading claims token', query={'device': 'web'},