videos_dev.py 618 B

123456789101112131415161718192021222324252627282930313233
  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-01",
  15. "end_date": "2024-07-06",
  16. "topN": 800
  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(len(response.json()['data']))
  26. for i in response.json()['data']:
  27. print(i['title'])
  28. print(i['video_url'])
  29. print("\n")