test.py 530 B

123456789101112131415161718192021222324
  1. import json
  2. import requests
  3. def request_for_info(video_id):
  4. """
  5. 请求数据
  6. :param video_id:
  7. :return:
  8. """
  9. url = "https://longvideoapi.piaoquantv.com/longvideoapi/openapi/video/batchSelectVideoInfo"
  10. data = {
  11. "videoIdList": [video_id]
  12. }
  13. header = {
  14. "Content-Type": "application/json",
  15. }
  16. response = requests.post(url, headers=header, data=json.dumps(data))
  17. return response.json()
  18. r = request_for_info("20964481")
  19. print(json.dumps(r, ensure_ascii=False, indent=4))