@@ -412,7 +412,6 @@ def parse_html_to_search_page(cls, html: str) -> JmSearchPage:
412412
413413 @classmethod
414414 def parse_html_to_category_page (cls , html : str ) -> JmSearchPage :
415- # 3. 提取结果
416415 content = []
417416 total = int (PatternTool .match_or_default (html , * cls .pattern_html_search_total ))
418417
@@ -429,7 +428,6 @@ def parse_html_to_category_page(cls, html: str) -> JmSearchPage:
429428
430429 return JmSearchPage (content , total )
431430
432-
433431 @classmethod
434432 def parse_html_to_favorite_page (cls , html : str ) -> JmFavoritePage :
435433 total = int (PatternTool .require_match (
@@ -893,8 +891,8 @@ class JmCryptoTool:
893891 @classmethod
894892 def token_and_tokenparam (cls ,
895893 ts ,
896- ver = JmMagicConstants . APP_VERSION ,
897- secret = JmMagicConstants . APP_TOKEN_SECRET ,
894+ ver = None ,
895+ secret = None ,
898896 ):
899897 """
900898 计算禁漫接口的请求headers的token和tokenparam
@@ -905,6 +903,12 @@ def token_and_tokenparam(cls,
905903 :return (token, tokenparam)
906904 """
907905
906+ if ver is None :
907+ ver = JmMagicConstants .APP_VERSION
908+
909+ if secret is None :
910+ secret = JmMagicConstants .APP_TOKEN_SECRET
911+
908912 # tokenparam: 1700566805,1.6.3
909913 tokenparam = '{},{}' .format (ts , ver )
910914
@@ -917,7 +921,7 @@ def token_and_tokenparam(cls,
917921 def decode_resp_data (cls ,
918922 data : str ,
919923 ts ,
920- secret = JmMagicConstants . APP_DATA_SECRET ,
924+ secret = None ,
921925 ) -> str :
922926 """
923927 解密接口返回值
@@ -927,6 +931,9 @@ def decode_resp_data(cls,
927931 :param secret: 密钥
928932 :return: json格式的字符串
929933 """
934+ if secret is None :
935+ secret = JmMagicConstants .APP_DATA_SECRET
936+
930937 # 1. base64解码
931938 import base64
932939 data_b64 = base64 .b64decode (data )
0 commit comments