__init__.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import requests
  2. def search_user(keyword):
  3. url = 'https://wxmini-api.uyouqu.com/rest/wd/wechatApp/search/user?'
  4. data = {
  5. "keyword": keyword,
  6. "pcursor": "",
  7. "ussid": ""
  8. }
  9. return requests.post(url, headers=headers, json=data).text
  10. def search_video(keyword):
  11. url = 'https://wxmini-api.uyouqu.com/rest/wd/wechatApp/search/feed?'
  12. data = {
  13. "keyword": keyword,
  14. "pcursor": "",
  15. "ussid": "",
  16. "pageSource": 1
  17. }
  18. return requests.post(url, headers=headers, json=data).text
  19. def video_info():
  20. url = 'https://wxmini-api.uyouqu.com/rest/wd/wechatApp/photo/info?'
  21. data = {
  22. "kpn": "WECHAT_SMALL_APP",
  23. "photoId": "5254293468891588895",
  24. "authorId": "1346454001",
  25. "usePrefetch": True,
  26. "pageType": 1,
  27. "pageSource": 3
  28. }
  29. return requests.post(url, headers=headers, json=data).text
  30. def video_comment():
  31. url = 'https://wxmini-api.uyouqu.com/rest/wd/wechatApp/photo/comment/list?'
  32. data = {
  33. "photoId": "5254293468891588895",
  34. "count": 20
  35. }
  36. return requests.post(url, headers=headers, json=data).text
  37. def user_profile():
  38. url = 'https://wxmini-api.uyouqu.com/rest/wd/wechatApp/user/profile?'
  39. data = {
  40. "eid": "1084678836"
  41. }
  42. return requests.post(url, headers=headers, json=data).text
  43. user_agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36 MicroMessenger/7.0.9.501 NetType/WIFI MiniProgramEnv/Windows WindowsWechat'
  44. referer = 'https://servicewechat.com/wx79a83b1a1e8a7978/591/page-frame.html'
  45. cookie = 'did=填入你的'
  46. headers = {
  47. 'Host': 'wxmini-api.uyouqu.com',
  48. # 'referer':referer,
  49. 'User-Agent': user_agent,
  50. 'cookie': cookie
  51. }
  52. data = {
  53. "keyword": "河南到底有多热",
  54. "pcursor": "",
  55. "ussid": "",
  56. "pageSource": 1
  57. }
  58. print(search_video('lx'))