|
@@ -7,6 +7,7 @@ import re
|
|
|
import random
|
|
|
from zipfile import ZipFile
|
|
|
|
|
|
+import jwt
|
|
|
from plyer import notification
|
|
|
from selenium import webdriver
|
|
|
from bs4 import BeautifulSoup
|
|
@@ -45,9 +46,17 @@ class Anafoauth(object):
|
|
|
default = 'unknow'
|
|
|
expires_at = self.token_dict.get('expires_at', default)
|
|
|
expires_at = datetime.datetime.fromtimestamp(expires_at)
|
|
|
- print(expires_at)
|
|
|
+ print(expires_at.strftime('%d-%m-%Y %H:%M:%S'))
|
|
|
return expires_at > datetime.datetime.today()
|
|
|
|
|
|
+ def jwt_props(self, path):
|
|
|
+ with open(path) as token_file:
|
|
|
+ token_dict = ujson.load(token_file)
|
|
|
+ token = token_dict['access_token']
|
|
|
+ decoded_token = jwt.decode(token, options={'verify_signature': False})
|
|
|
+ # print(decoded_token)
|
|
|
+ return decoded_token
|
|
|
+
|
|
|
def get_token(self) -> ujson:
|
|
|
# https://chat.openai.com/c/61c5c1c5-298a-4073-88c7-d69ce99a140e
|
|
|
# oauth = OAuth2Session(self.client_id, redirect_uri=self.redirect_uri)
|