videos_dev.py 643 B

12345678910111213141516171819202122232425262728293031
  1. """
  2. @author: luojunhui
  3. """
  4. import json
  5. import time
  6. import requests
  7. """
  8. cate: video_return, video_view, video_rov
  9. """
  10. url = "http://47.99.132.47:8888/videos"
  11. body = {
  12. "cate": "video_return",
  13. "start_date": "2024-05-28",
  14. "end_date": "2024-05-29",
  15. "topN": 5
  16. }
  17. a = time.time()
  18. header = {
  19. "Content-Type": "application/json",
  20. }
  21. response = requests.post(url, json=body, headers=header, timeout=600)
  22. b = time.time()
  23. print(b - a)
  24. print(json.dumps(response.json(), ensure_ascii=False, indent=4))
  25. # with open("test_return.json", "w", encoding="utf-8") as f:
  26. # f.write(json.dumps(response.json(), ensure_ascii=False, indent=4))