| 5 | from base.spider import Spider |
| 6 | |
| 7 | class Spider(Spider): |
| 8 | def getDependence(self): |
| 9 | return ['py_ali'] |
| 10 | def getName(self): |
| 11 | return "py_zhaozy" |
| 12 | def init(self,extend): |
| 13 | self.ali = extend[0] |
| 14 | print("============py_zhaozy============") |
| 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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36", |
| 31 | "Referer": "https://zhaoziyuan.me/" |
| 32 | } |
| 33 | def detailContent(self,array): |
| 34 | tid = array[0] |
| 35 | print(self.getName()) |
| 36 | pattern = '(https://www.aliyundrive.com/s/[^\"]+)' |
| 37 | url = self.regStr(tid,pattern) |
| 38 | if len(url) > 0: |
| 39 | return self.ali.detailContent(array) |
| 40 | |
| 41 | rsp = self.fetch('https://zhaoziyuan.me/'+tid) |
| 42 | url = self.regStr(rsp.text,pattern) |
| 43 | if len(url) == 0: |
| 44 | return "" |
| 45 | newArray = [url] |
| 46 | print(newArray) |
| 47 | return self.ali.detailContent(newArray) |
| 48 | |
| 49 | def searchContent(self,key,quick): |
| 50 | map = { |
| 51 | '7':'文件夹', |
| 52 | '1':'视频' |
| 53 | } |
| 54 | ja = [] |
| 55 | for tKey in map.keys(): |
| 56 | url = "https://zhaoziyuan.me/so?filename={0}&t={1}".format(key,tKey) |
| 57 | rsp = self.fetch(url,headers=self.header) |
| 58 | root = self.html(self.cleanText(rsp.text)) |
| 59 | aList = root.xpath("//li[@class='clear']//a") |
| 60 | for a in aList: |
| 61 | # title = a.xpath('./h3/text()')[0] + a.xpath('./p/text()')[0] |
| 62 | title = self.xpText(a,'./h3/text()') + self.xpText(a,'./p/text()') |
| 63 | pic = 'https://img0.baidu.com/it/u=603086994,1727626977&fm=253&fmt=auto?w=500&h=667' |
| 64 | jo = { |
nothing calls this directly
no outgoing calls
no test coverage detected