mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-03-09 12:50:23 -05:00
Move _is_jwt_token_expired
back to VrtNUIE
This commit is contained in:
parent
6465be6c2f
commit
d6eaff7b74
2 changed files with 5 additions and 5 deletions
|
@ -69,7 +69,6 @@
|
|||
int_or_none,
|
||||
join_nonempty,
|
||||
js_to_json,
|
||||
jwt_decode_hs256,
|
||||
mimetype2ext,
|
||||
netrc_from_content,
|
||||
orderedSet,
|
||||
|
@ -995,10 +994,6 @@ def _guess_encoding_from_content(content_type, webpage_bytes):
|
|||
|
||||
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
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
get_element_by_class,
|
||||
get_element_html_by_class,
|
||||
int_or_none,
|
||||
jwt_decode_hs256,
|
||||
jwt_encode_hs256,
|
||||
make_archive_id,
|
||||
merge_dicts,
|
||||
|
@ -308,6 +309,10 @@ def _get_video_token_from_cookie(self):
|
|||
def _get_refresh_token_from_cookie(self):
|
||||
return try_call(lambda: self._get_cookies('https://www.vrt.be/vrtmax/sso')['vrtnu-site_profile_rt'].value)
|
||||
|
||||
@staticmethod
|
||||
def _is_jwt_token_expired(token):
|
||||
return jwt_decode_hs256(token)['exp'] - time.time() < 300
|
||||
|
||||
def _perform_login(self, username, password):
|
||||
if self._fetch_refresh_token():
|
||||
self.write_debug('Refresh token already present, skipping login')
|
||||
|
|
Loading…
Reference in a new issue