videos_dev.py 548 B

1234567891011121314151617181920212223242526272829
  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. url = "http://localhost:8888/videos"
  12. body = {
  13. "cate": "video_return",
  14. "start_date": "2024-06-05",
  15. "end_date": "2024-06-06",
  16. "topN": 50
  17. }
  18. a = time.time()
  19. header = {
  20. "Content-Type": "application/json",
  21. }
  22. response = requests.post(url, json=body, headers=header, timeout=600)
  23. b = time.time()
  24. print(b - a)
  25. print(json.dumps(response.json(), ensure_ascii=False, indent=4))