main_request.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import json
  2. import requests
  3. headers = {
  4. 'Host': 'api.xiahong.top',
  5. # 'ik': 'b326b5062b2f0e69046810717534cb09',
  6. 'xweb_xhr': '1',
  7. 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/6.8.0(0x16080000) NetType/WIFI MiniProgramEnv/Mac MacWechat/WMPF MacWechat/3.8.5(0x13080510)XWEB/1100',
  8. 'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3MDIwMjU1MTgsIm5iZiI6MTcwMjAyNTUxOCwiZXhwIjoxNzAyMDMyNzE4LCJkYXRhIjp7InVzZXJfaWQiOiIyMzkyNDc3NDAifX0.SGfKqlSL11OxDtx5t2XvYXsxTC0hSR--5QpdOmWPIKU',
  9. 'Content-Type': 'application/json',
  10. 'Accept': '*/*',
  11. 'Sec-Fetch-Site': 'cross-site',
  12. 'Sec-Fetch-Mode': 'cors',
  13. 'Sec-Fetch-Dest': 'empty',
  14. 'Referer': 'https://servicewechat.com/wxe5389a260a0a4ee2/2/page-frame.html',
  15. 'Accept-Language': 'en-US,en;q=0.9',
  16. }
  17. params = {
  18. 's': 'mobile/Video/getList',
  19. 'cid': '1',
  20. 'page': '11',
  21. 'api_version': '4',
  22. 'appid': 'wxe5389a260a0a4ee2',
  23. 'version': '1.9.1',
  24. 'env_version': 'release',
  25. 'scene': '1089'
  26. }
  27. response = requests.get('https://api.xiahong.top/index.php', headers=headers, params=params)
  28. result = response.json()
  29. print(json.dumps(result, ensure_ascii=False, indent=4))
  30. print(len(result['data']['list']))