videos_dev.py 637 B

12345678910111213141516171819202122232425262728293031323334
  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-07-10",
  15. "end_date": "2024-07-11",
  16. "topN": 500
  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)
  28. print(i['title'])
  29. # print(i['video_url'])
  30. # print("\n")