| 62 | } |
| 63 | return result |
| 64 | def categoryContent(self,tid,pg,filter,extend): |
| 65 | result = {} |
| 66 | |
| 67 | urlParams = ["", "", "", "", "", "", "", "", "", "", "", ""] |
| 68 | urlParams[0] = tid |
| 69 | urlParams[8] = pg |
| 70 | for key in extend: |
| 71 | urlParams[int(key)] = extend[key] |
| 72 | params = '-'.join(urlParams) |
| 73 | url = 'https://xmaomi.net/vod_____show/{0}.html'.format(params) |
| 74 | tmpRsp = self.fetch(url) |
| 75 | suffix = self.regStr(tmpRsp.text,"window.location.href =\"(\\S+)\"") |
| 76 | url = 'https://xmaomi.net'+suffix |
| 77 | rsp = self.fetch(url,cookies=tmpRsp.cookies) |
| 78 | root = self.html(rsp.text) |
| 79 | print(rsp.text[0]) |
| 80 | print(root) |
| 81 | aList = root.xpath("//ul[contains(@class,'hl-vod-list')]/li/a") |
| 82 | videos = [] |
| 83 | for a in aList: |
| 84 | name = a.xpath('./@title')[0] |
| 85 | pic = a.xpath('./@data-original')[0] |
| 86 | mark = a.xpath("./div[@class='hl-pic-text']/span/text()")[0] |
| 87 | sid = a.xpath("./@href")[0] |
| 88 | sid = self.regStr(sid,"/(\\S+).html") |
| 89 | videos.append({ |
| 90 | "vod_id":sid, |
| 91 | "vod_name":name, |
| 92 | "vod_pic":pic, |
| 93 | "vod_remarks":mark |
| 94 | }) |
| 95 | result['list'] = videos |
| 96 | result['page'] = pg |
| 97 | result['pagecount'] = 9999 |
| 98 | result['limit'] = 90 |
| 99 | result['total'] = 999999 |
| 100 | return result |
| 101 | def detailContent(self,array): |
| 102 | tid = array[0] |
| 103 | url = 'https://xmaomi.net/{0}.html'.format(tid) |