py_alist.py 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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://pan.hikerfans.com",
  21. "🦀9T(Adult)":"https://drive.9t.ee",
  22. "🐱梓澪の妙妙屋":"https://xn--i0v44m.xyz",
  23. "🚆资源小站":"https://pan.142856.xyz",
  24. "🌤晴园的宝藏库":"https://alist.52qy.repl.co",
  25. "🐭米奇妙妙屋":"https://anime.mqmmw.ga",
  26. "💂小兵组网盘影视":"https://6vv.app",
  27. "📀小光盘":"https://alist.xiaoguanxiaocheng.life",
  28. "🐋一只鱼":"https://alist.youte.ml",
  29. "🦬千牛盘":"https://alist.qnpan.com",
  30. "🌴非盘":"http://www.feifwp.top",
  31. "🥼帅盘":"https://hi.shuaipeng.wang",
  32. "🐉神族九帝":"https://alist.shenzjd.com",
  33. "☃姬路白雪":"https://pan.jlbx.xyz",
  34. "🎧听闻网盘":"https://wangpan.sangxuesheng.com",
  35. "💾DISK":"http://124.222.140.243:8080",
  36. "🌨云播放":"https://quanzi.laoxianghuijia.cn",
  37. "✨星梦":"https://pan.bashroot.top",
  38. "🌊小江":"https://dyj.me",
  39. "💫触光":"https://pan.ichuguang.com",
  40. "🕵好汉吧":"https://8023.haohanba.cn",
  41. "🥗AUNEY":"http://121.227.25.116:8008",
  42. "🎡资源小站":"https://960303.xyz/",
  43. "🐝神器云": "https://quanzi.laoxianghuijia.cn",
  44. "🏝fenwe":"http://www.fenwe.tk:5244",
  45. "🎢轻弹浅唱":"https://g.xiang.lol"
  46. }
  47. classes = []
  48. for k in cateManual:
  49. classes.append({
  50. 'type_name': k,
  51. "type_flag": "1",
  52. 'type_id': cateManual[k]
  53. })
  54. result['class'] = classes
  55. if (filter):
  56. result['filters'] = self.config['filter']
  57. return result
  58. def homeVideoContent(self):
  59. result = {
  60. 'list': []
  61. }
  62. return result
  63. def categoryContent(self, tid, pg, filter, extend):
  64. result = {}
  65. ulen = len(self.config['url'])
  66. pat = tid[ulen:] + '/'
  67. param = {
  68. "path": pat
  69. }
  70. rsp = self.postJson(self.config['url'] + '/api/fs/list', param)
  71. jo = json.loads(rsp.text)
  72. videos = []
  73. vodList = jo['data']['content']
  74. for vod in vodList:
  75. img = vod['thumb']
  76. if len(img) == 0:
  77. if vod['type'] == 1:
  78. img = "http://img1.3png.com/281e284a670865a71d91515866552b5f172b.png"
  79. aid = pat
  80. tag = "file"
  81. remark = "文件"
  82. if vod['type'] == 1:
  83. tag = "folder"
  84. remark = "文件夹"
  85. aid = self.config['url'] + aid + vod['name']
  86. else:
  87. aid = aid + vod['name']
  88. videos.append({
  89. "vod_id": aid,
  90. "vod_name": vod['name'],
  91. "vod_pic": img,
  92. "vod_tag": tag,
  93. "vod_remarks": remark
  94. })
  95. result['list'] = videos
  96. result['page'] = 1
  97. result['pagecount'] = 1
  98. result['limit'] = 999
  99. result['total'] = 999999
  100. return result
  101. def detailContent(self, array):
  102. fileName = array[0]
  103. param = {
  104. "path": fileName,
  105. "password": "",
  106. "page_num": 1,
  107. "page_size": 100
  108. }
  109. rsp = self.postJson(self.config['url'] + '/api/fs/get', param)
  110. jo = json.loads(rsp.text)
  111. videos = []
  112. vodList = jo['data']
  113. url = vodList['raw_url']
  114. vId = self.config['url'] + fileName
  115. name = vodList['name']
  116. pic = vodList['thumb']
  117. tag = "file"
  118. if vodList['type'] == 1:
  119. tag = "folder"
  120. vod = {
  121. "vod_id": vId,
  122. "vod_name": name,
  123. "vod_pic": pic,
  124. "vod_tag": tag,
  125. "vod_play_from": "播放",
  126. "vod_play_url": name + '$' + url
  127. }
  128. result = {
  129. 'list': [
  130. vod
  131. ]
  132. }
  133. return result
  134. def searchContent(self, key, quick):
  135. result = {
  136. 'list': []
  137. }
  138. return result
  139. def playerContent(self, flag, id, vipFlags):
  140. result = {}
  141. url = id
  142. result["parse"] = 0
  143. result["playUrl"] = ''
  144. result["url"] = url
  145. return result
  146. config = {
  147. "player": {},
  148. "filter": {},
  149. "url": 'https://al.chirmyram.com'
  150. }
  151. header = {}
  152. def localProxy(self, param):
  153. return [200, "video/MP2T", action, ""]