search.py 962 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. """
  2. @author: luojunhui
  3. """
  4. from typing import Dict
  5. from applications.api import WechatChannelAPI
  6. from config import gewe_token, gewe_app_id, gewe_base_url
  7. def search_in_wechat_channel(
  8. search_key: str,
  9. search_type: int,
  10. page: int = 0,
  11. cookie: str = "",
  12. search_id: str = "",
  13. offset: int = 0,
  14. ) -> Dict:
  15. """
  16. :param search_key: 搜索关键字
  17. :param search_type: 搜索类型,1: 搜索所有视频, 2: 搜索视频号账号
  18. :param page: 页码
  19. :param cookie: 登录后的cookie
  20. :param search_id: 搜索id
  21. :param offset: 偏移量
  22. :return: result_list
  23. """
  24. channel_api = WechatChannelAPI(
  25. base_url=gewe_base_url,
  26. token=gewe_token,
  27. app_id=gewe_app_id
  28. )
  29. result = channel_api.search(
  30. search_key=search_key,
  31. search_type=search_type,
  32. page=page,
  33. cookie=cookie,
  34. search_id=search_id,
  35. offset=offset
  36. )
  37. return result