MCPcopy Create free account
hub / github.com/UndCover/PyramidStore / Spider

Class Spider

plugin/py_ali.py:11–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9import re
10
11class Spider(Spider): # 元类 默认的元类 type
12 def getName(self):
13 return "阿里云盘"
14 def init(self,extend=""):
15 print("============{0}============".format(extend))
16 pass
17 def homeContent(self,filter):
18 result = {}
19 return result
20 def homeVideoContent(self):
21 result = {}
22 return result
23 def categoryContent(self,tid,pg,filter,extend):
24 result = {}
25 return result
26 def searchContent(self,key,quick):
27 result = {}
28 return result
29 def isVideoFormat(self,url):
30 pass
31 def manualVideoCheck(self):
32 pass
33 def playerContent(self,flag,id,vipFlags):
34 if flag == 'AliYun':
35 return self.originContent(flag,id,vipFlags)
36 elif flag == 'AliYun原画':
37 return self.fhdContent(flag,id,vipFlags)
38 else:
39 return {}
40 def fhdContent(self,flag,id,vipFlags):
41 if not self.login():
42 return {}
43 ids = id.split('+')
44 shareId = ids[0]
45 shareToken = ids[1]
46 fileId = ids[2]
47 category = ids[3]
48 url = self.getDownloadUrl(shareId,shareToken,fileId,category)
49 print(url)
50
51 noRsp = requests.get(url,headers=self.header, allow_redirects=False,verify = False)
52 realUrl = ''
53 if 'Location' in noRsp.headers:
54 realUrl = noRsp.headers['Location']
55 if 'location' in noRsp.headers and len(realUrl) == 0 :
56 realUrl = noRsp.headers['location']
57 newHeader = {
58 "user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36",
59 "referer":"https://www.aliyundrive.com/",
60 }
61 result = {
62 'parse':'0',
63 'playUrl':'',
64 'url':realUrl,
65 'header':newHeader
66 }
67 return result
68 def originContent(self,flag,id,vipFlags):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected