py_if101.py 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #coding=utf-8
  2. #!/usr/bin/python
  3. import sys
  4. sys.path.append('..')
  5. from base.spider import Spider
  6. import json
  7. import urllib.parse
  8. class Spider(Spider):
  9. def getName(self):
  10. return "IF101影视"
  11. def init(self,extend=""):
  12. print("============{0}============".format(extend))
  13. pass
  14. def homeContent(self,filter):
  15. result = {}
  16. classes = [{"type_id":24,"type_name":"体育"},{"type_id":25,"type_name":"纪录片"},{"type_id":28,"type_name":"冒险片"},{"type_id":29,"type_name":"剧情片"},{"type_id":30,"type_name":"动作片"},{"type_id":31,"type_name":"动画电影"},{"type_id":32,"type_name":"同性片"},{"type_id":33,"type_name":"喜剧片"},{"type_id":34,"type_name":"奇幻片"},{"type_id":35,"type_name":"恐怖片"},{"type_id":36,"type_name":"悬疑片"},{"type_id":37,"type_name":"惊悚片"},{"type_id":38,"type_name":"歌舞片"},{"type_id":39,"type_name":"灾难片"},{"type_id":40,"type_name":"爱情片"},{"type_id":41,"type_name":"犯罪片"},{"type_id":42,"type_name":"科幻片"},{"type_id":43,"type_name":"经典片"},{"type_id":44,"type_name":"网络电影"},{"type_id":117,"type_name":"战争片"},{"type_id":119,"type_name":"欧美剧"},{"type_id":120,"type_name":"日剧"},{"type_id":121,"type_name":"韩剧"},{"type_id":122,"type_name":"国产剧"},{"type_id":123,"type_name":"泰剧"},{"type_id":124,"type_name":"港剧"},{"type_id":125,"type_name":"台剧"},{"type_id":126,"type_name":"新马剧"},{"type_id":127,"type_name":"其他剧"},{"type_id":128,"type_name":"欧美综艺"},{"type_id":129,"type_name":"日本综艺"},{"type_id":130,"type_name":"韩国综艺"},{"type_id":131,"type_name":"国产综艺"},{"type_id":132,"type_name":"新马泰综艺"},{"type_id":133,"type_name":"港台综艺"},{"type_id":134,"type_name":"其他综艺"},{"type_id":135,"type_name":"欧美动漫"},{"type_id":136,"type_name":"日本动漫"},{"type_id":137,"type_name":"韩国动漫"},{"type_id":138,"type_name":"国产动漫"},{"type_id":139,"type_name":"新马泰动漫"},{"type_id":140,"type_name":"港台动漫"},{"type_id":142,"type_name":"其他动漫"}]
  17. result['class'] = classes
  18. return result
  19. def homeVideoContent(self):
  20. rsp = self.fetch("https://api.8a5.cn/parse/if101/py.php?do=homeVideoContent")
  21. alists = json.loads(rsp.text)
  22. alist = alists['list']
  23. result = {
  24. 'list':alist
  25. }
  26. return result
  27. def categoryContent(self,tid,pg,filter,extend):
  28. result = {}
  29. urlParams = []
  30. params = ''
  31. for key in extend:
  32. urlParams.append(str(key) + '=' + extend[key])
  33. params = '&'.join(urlParams)
  34. url = 'https://api.8a5.cn/parse/if101/py.php?do=categoryContent&tid={0}&page={1}&{2}'.format(tid, pg,params)
  35. rsp = self.fetch(url)
  36. alists = json.loads(rsp.text)
  37. alist = alists['list']
  38. result['list'] = alist
  39. result['page'] = pg
  40. result['pagecount'] = 9999
  41. result['limit'] = 90
  42. result['total'] = 999999
  43. return result
  44. def detailContent(self,array):
  45. tid = array[0]
  46. url = 'https://api.8a5.cn/parse/if101/py.php?do=detailContent&id={0}'.format(tid)
  47. rsp = self.fetch(url)
  48. alists = json.loads(rsp.text)
  49. vod = alists['vod']
  50. result = {
  51. 'list':[
  52. vod
  53. ]
  54. }
  55. return result
  56. def searchContent(self,key,quick):
  57. url = 'https://api.8a5.cn/parse/if101/py.php?do=searchContent&wd={0}'.format(key)
  58. rsp = self.fetch(url)
  59. alists = json.loads(rsp.text)
  60. list = alists['list']
  61. result = {
  62. 'list':list
  63. }
  64. return result
  65. def playerContent(self,flag,id,vipFlags):
  66. result = {}
  67. id = 'https://api.8a5.cn/parse/if101/get.php?url=' + urllib.parse.quote(id)
  68. result["parse"] = 0
  69. result["playUrl"] = ''
  70. result["url"] = id
  71. return result
  72. def isVideoFormat(self,url):
  73. pass
  74. def manualVideoCheck(self):
  75. pass
  76. def localProxy(self,param):
  77. return [200, "video/MP2T", action, ""]