易搜.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #coding=utf-8
  2. #!/usr/bin/python
  3. import sys
  4. sys.path.append('..')
  5. from base.spider import Spider
  6. import requests
  7. class Spider(Spider):
  8. def getDependence(self):
  9. return ['py_ali']
  10. def getName(self):
  11. return "py_yiso"
  12. def init(self,extend):
  13. self.ali = extend[0]
  14. print("============py_yiso============")
  15. pass
  16. def isVideoFormat(self,url):
  17. pass
  18. def manualVideoCheck(self):
  19. pass
  20. def homeContent(self,filter):
  21. result = {}
  22. return result
  23. def homeVideoContent(self):
  24. result = {}
  25. return result
  26. def categoryContent(self,tid,pg,filter,extend):
  27. result = {}
  28. return result
  29. header = {
  30. "User-Agent": "Mozilla/5.0 (Linux; Android 12; V2049A Build/SP1A.210812.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/103.0.5060.129 Mobile Safari/537.36",
  31. "Referer": "https://yiso.fun/"
  32. }
  33. def detailContent(self,array):
  34. return self.ali.detailContent(array)
  35. def searchContent(self,key,quick):
  36. url = "https://yiso.fun/api/search?name={0}&from=ali".format(key)
  37. vodList = requests.get(url=url, headers=self.header, verify=False).json()["data"]["list"]
  38. videos = []
  39. for vod in vodList:
  40. videos.append({
  41. "vod_id": vod["url"],
  42. "vod_name": vod["fileInfos"][0]["fileName"],
  43. "vod_pic": "https://inews.gtimg.com/newsapp_bt/0/13263837859/1000",
  44. "vod_remarks": vod['gmtCreate']
  45. })
  46. result = {
  47. 'list':videos
  48. }
  49. return result
  50. def playerContent(self,flag,id,vipFlags):
  51. return self.ali.playerContent(flag,id,vipFlags)
  52. config = {
  53. "player": {},
  54. "filter": {}
  55. }
  56. header = {}
  57. def localProxy(self,param):
  58. return [200, "video/MP2T", action, ""]