| 174 | } |
| 175 | return result |
| 176 | def searchContent(self,key,quick): |
| 177 | url = 'https://xmaomi.net/v_search/{0}-------------.html'.format(key) |
| 178 | tmpRsp = self.fetch(url) |
| 179 | suffix = self.regStr(tmpRsp.text,"window.location.href =\"(\\S+)\"") |
| 180 | url = "https://xmaomi.net"+suffix |
| 181 | rsp = self.fetch(url,cookies=tmpRsp.cookies) |
| 182 | root = self.html(rsp.text) |
| 183 | print(rsp.text[0]) |
| 184 | print(root) |
| 185 | aList = root.xpath("//ul[contains(@class,'hl-one-list')]/li//a[contains(@class,'hl-item-thumb')]") |
| 186 | videos = [] |
| 187 | for a in aList: |
| 188 | name = a.xpath('./@title')[0] |
| 189 | print(name) |
| 190 | pic = a.xpath('./@data-original')[0] |
| 191 | print(pic) |
| 192 | mark = a.xpath("./div[@class='hl-pic-text']/span/text()")[0] |
| 193 | sid = a.xpath("./@href")[0] |
| 194 | sid = self.regStr(sid,"/(\\S+).html") |
| 195 | videos.append({ |
| 196 | "vod_id":sid, |
| 197 | "vod_name":name, |
| 198 | "vod_pic":pic, |
| 199 | "vod_remarks":mark |
| 200 | }) |
| 201 | result = { |
| 202 | 'list':videos |
| 203 | } |
| 204 | return result |
| 205 | def playerContent(self,flag,id,vipFlags): |
| 206 | url = 'https://xmaomi.net/{0}.html'.format(id) |
| 207 | tmpRsp = self.fetch(url) |