auspi12341 发表于 2022-4-13 16:44

采集知X问题全部回答有点问题 ,求解

def get_headers(self):
      star = 'd_c0='
      end = ';'
      cookie_mes = self.cookie.replace(star, '')
      cookie_mes = cookie_mes[:cookie_mes.index(end)]
      f = "+".join(["101_3_2.0", self.parse_url, cookie_mes])
      fmd5 = hashlib.new('md5', f.encode()).hexdigest()
      with open('g_encrypt.js', 'r') as f:
            ctx1 = execjs.compile(f.read(), cwd=r'C:\Users\boss\AppData\Roaming\npm\node_modules')
            
      kk = ctx1.call('b', fmd5)
      print(kk)
      encrypt_str = "2.0_%s" % kk
      headers = {
            "x-ab-param" : 'tp_topic_style=0;tp_dingyue_video=0;pf_adjust=1;top_test_4_liguangyi=1;pf_noti_entry_num=2;tp_zrec=1;qap_question_author=0;se_ffzx_jushen1=0;tp_contents=2;qap_question_visitor= 0',
            "x-api-version": "3.0.91",
            "x-ab-pb": "CogCEQUSCRYJQwB0ATMFLgnjBYsJTwNnCI0J9gJBBjYJVgVCCd0HjAXkClYMogPrBosFngWJCD8J1wsHDIQCFgY3CTsCYQm1C8UIoQMzBCoGowlAATIDUAOrCbkCRwAnBzQJGwChCTQMAQmMBOcFdAgnCTAJVAngC+kEqAmiBuwKewdXB3cHeAdgC6ADUgu0ADEGqwbWCH0CUQVJCfQLpgSUBrcDKQUBC7QK1wJSBWoBzALWBPQDVQkLBFcEgAUnCDEJNww/BgEGKgMyCTUJZgd6CNwIMgUwBqYGPwCbB5gIDwuNBLIHdQmRCdgH3AflCE8HLwncC/MDAghsCNoImwvPC2kB2AJ2CIQJEoQBAAAAFQAAAAAAAAEAAAAAAAACAAABAAAAAQAHAAEAAAABAAMAAAAAAAEAAAAVAAAAAAAAAAQAAAAAAAAAAAIBAAEAAAAAAQABAAABAQEAAAAAAAAAAAAAAAQAAAABAAAAAQAAAgAAAQAAAwAAAAEDAQQAAAEAAgAAAAAAAQEAAgsBAAAA",
            'x-app-za': 'OS=Web',
            "x-zse-93": "101_3_2.0",
            "x-zse-96": encrypt_str,
            "x-app-version": "5.22.3",
            "x-zst-82": "1.0ALAd58UDxRQMAAAASwUAADEuMGLhUmIAAAAATKIfH4IXi2dpaAxFDNFgAFCquYs=",
            "x-zst-81": "3_2.0ae3TnRUTEvOOUCNMTQnTSHUZo02p-HNMZBO8YD_qo6Ppb7tqXRFZQi90-LS9-hp1DufI-we8gGHPgJO1xuPZ0GxCTJHR7820XM20cLRGDJXfgGCBxupMuD_Ie8FL7AtqM6O1VDQyQ6nxrRPCHukMoCXBEgOsiRP0XL2ZUBXmDDV9qhnyTXFMnXcTF_ntRueThRgKxhoqFbXKUCxOJbLCk4omJcNpSHwBTDS8kqo0PhS9FCOm_cHYIg9yeuCPv0OKpBO1s9O0fqXxCrOmpqYKp9e0HuV_bAL_YGwBCDpKaBVKfrL8Hvem9bCKaw2L9qV_HuwKZvumicnByheBFrH1Dhcfo02sq9xCYXN0iUCZrAO1VvO0vqfzQ8HMeXH_ewx97USGNhCyaBppnGN_sH2GX9Xyc0S9SCS0ugCY9hXOiqNpEUHLnBLq8Ur9pbNp8cXBRGoMwqHMcBx8eTOO1cXMfUc03qpLgDcf-hXOwBeC",
            "User-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36",
      }
      self.zh_ask(headers)

已经使用g_encrypt.js 生成了 x-zse-96 加密字符串 但是请求回答分页的时候还是提示版本不对,求解怎么解决
页: [1]
查看完整版本: 采集知X问题全部回答有点问题 ,求解