alist.py 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. class Spider(Spider): # 元类 默认的元类 type
  8. def getName(self):
  9. return "Alist"
  10. def init(self, extend=""):
  11. print("============{0}============".format(extend))
  12. pass
  13. def isVideoFormat(self, url):
  14. pass
  15. def manualVideoCheck(self):
  16. pass
  17. def homeContent(self, filter):
  18. result = {}
  19. cateManual = {
  20. "🌊七米蓝":"https://al.chirmyram.com",
  21. "🌴非盘":"http://www.feifwp.top",
  22. "🐉神族九帝":"https://alist.shenzjd.com",
  23. "☃姬路白雪":"https://pan.jlbx.xyz",
  24. "🎧听闻网盘":"https://wangpan.sangxuesheng.com",
  25. "💾DISK":"http://124.222.140.243:8080",
  26. "🌨云播放":"https://quanzi.laoxianghuijia.cn",
  27. "✨星梦":"https://pan.bashroot.top",
  28. "🌊小江":"https://dyj.me",
  29. "💫触光":"https://pan.ichuguang.com",
  30. "🕵好汉吧":"https://8023.haohanba.cn",
  31. "🥗AUNEY":"http://121.227.25.116:8008",
  32. "🎡资源小站":"https://960303.xyz/",
  33. "🐝神器云": "https://quanzi.laoxianghuijia.cn",
  34. "🏝fenwe":"http://www.fenwe.tk:5244",
  35. "🎢轻弹浅唱":"https://g.xiang.lol"
  36. }
  37. classes = []
  38. for k in cateManual:
  39. classes.append({
  40. 'type_name': k,
  41. "type_flag": "1",
  42. 'type_id': cateManual[k]
  43. })
  44. result['class'] = classes
  45. if (filter):
  46. result['filters'] = self.config['filter']
  47. return result
  48. def homeVideoContent(self):
  49. result = {
  50. 'list': []
  51. }
  52. return result
  53. def categoryContent(self, tid, pg, filter, extend):
  54. result = {}
  55. ulen = len(self.config['url'])
  56. pat = tid[ulen:] + '/'
  57. param = {
  58. "path": pat
  59. }
  60. rsp = self.postJson(self.config['url'] + '/api/fs/list', param)
  61. jo = json.loads(rsp.text)
  62. videos = []
  63. vodList = jo['data']['content']
  64. for vod in vodList:
  65. img = vod['thumb']
  66. if len(img) == 0:
  67. if vod['type'] == 1:
  68. img = "http://img1.3png.com/281e284a670865a71d91515866552b5f172b.png"
  69. aid = pat
  70. tag = "file"
  71. remark = "文件"
  72. if vod['type'] == 1:
  73. tag = "folder"
  74. remark = "文件夹"
  75. aid = self.config['url'] + aid + vod['name']
  76. else:
  77. aid = aid + vod['name']
  78. videos.append({
  79. "vod_id": aid,
  80. "vod_name": vod['name'],
  81. "vod_pic": img,
  82. "vod_tag": tag,
  83. "vod_remarks": remark
  84. })
  85. result['list'] = videos
  86. result['page'] = 1
  87. result['pagecount'] = 1
  88. result['limit'] = 999
  89. result['total'] = 999999
  90. return result
  91. def detailContent(self, array):
  92. fileName = array[0]
  93. param = {
  94. "path": fileName,
  95. "password": "",
  96. "page_num": 1,
  97. "page_size": 100
  98. }
  99. rsp = self.postJson(self.config['url'] + '/api/fs/get', param)
  100. jo = json.loads(rsp.text)
  101. videos = []
  102. vodList = jo['data']
  103. url = vodList['raw_url']
  104. vId = self.config['url'] + fileName
  105. name = vodList['name']
  106. pic = vodList['thumb']
  107. tag = "file"
  108. if vodList['type'] == 1:
  109. tag = "folder"
  110. vod = {
  111. "vod_id": vId,
  112. "vod_name": name,
  113. "vod_pic": pic,
  114. "vod_tag": tag,
  115. "vod_play_from": "播放",
  116. "vod_play_url": name + '$' + url
  117. }
  118. result = {
  119. 'list': [
  120. vod
  121. ]
  122. }
  123. return result
  124. def searchContent(self, key, quick):
  125. result = {
  126. 'list': []
  127. }
  128. return result
  129. def playerContent(self, flag, id, vipFlags):
  130. result = {}
  131. url = id
  132. result["parse"] = 0
  133. result["playUrl"] = ''
  134. result["url"] = url
  135. return result
  136. config = {
  137. "player": {},
  138. "filter": {},
  139. "url": 'https://al.chirmyram.com'
  140. }
  141. header = {}
  142. def localProxy(self, param):
  143. return [200, "video/MP2T", action, ""]