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:
@@ -1,5 +1,4 @@
|
||||
import json
|
||||
import time
|
||||
import uuid
|
||||
|
||||
from .common import InfoExtractor
|
||||
@@ -124,10 +123,9 @@ class Zee5IE(InfoExtractor):
|
||||
else:
|
||||
raise ExtractorError(self._LOGIN_HINT, expected=True)
|
||||
|
||||
token = jwt_decode_hs256(self._USER_TOKEN)
|
||||
if token.get('exp', 0) <= int(time.time()):
|
||||
if self._is_jwt_token_expired(self._USER_TOKEN):
|
||||
raise ExtractorError('User token has expired', expected=True)
|
||||
self._USER_COUNTRY = token.get('current_country')
|
||||
self._USER_COUNTRY = jwt_decode_hs256(self._USER_TOKEN).get('current_country')
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id, display_id = self._match_valid_url(url).group('id', 'display_id')
|
||||
|
||||
Reference in New Issue
Block a user