1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-12-24 00:49:06 +00:00

move _jwt_is_expired to utils

This commit is contained in:
Michaël De Boey
2025-03-16 23:37:39 +01:00
parent 98a68be9b8
commit 1b1117a9c5
12 changed files with 32 additions and 22 deletions

View File

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