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
+5
View File
@@ -69,6 +69,7 @@ from ..utils import (
int_or_none,
join_nonempty,
js_to_json,
jwt_decode_hs256,
mimetype2ext,
netrc_from_content,
orderedSet,
@@ -994,6 +995,10 @@ class InfoExtractor:
return encoding
@staticmethod
def _is_jwt_token_expired(token):
return jwt_decode_hs256(token)['exp'] - time.time() < 300
def __check_blocked(self, content):
first_block = content[:512]
if ('<title>Access to this site is blocked</title>' in content