| 44 | return result |
| 45 | |
| 46 | def categoryContent(self, tid, pg, filter, extend): |
| 47 | result = {} |
| 48 | header = {"User-Agent": "Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Mobile Safari/537.36"} |
| 49 | url = 'https://www.30dian.cn/vodtype/{0}-{1}.html'.format(tid, pg) |
| 50 | rsp = self.fetch(url,headers=header) |
| 51 | root = self.html(self.cleanText(rsp.text)) |
| 52 | aList = root.xpath("//div[@class='myui-panel myui-panel-bg clearfix']/div/div/ul/li") |
| 53 | videos = [] |
| 54 | for a in aList: |
| 55 | name = a.xpath('./div/a/@title')[0] |
| 56 | pic = a.xpath('./div/a/@data-original')[0] |
| 57 | mark = a.xpath("./div/a/span/span[@class='tag']/text()")[0] |
| 58 | sid = a.xpath("./div/a/@href")[0].replace("/", "").replace("voddetail", "").replace(".html", "") |
| 59 | videos.append({ |
| 60 | "vod_id": sid, |
| 61 | "vod_name": name, |
| 62 | "vod_pic": pic, |
| 63 | "vod_remarks": mark |
| 64 | }) |
| 65 | result['list'] = videos |
| 66 | result['page'] = pg |
| 67 | result['pagecount'] = 999 |
| 68 | result['limit'] = 5 |
| 69 | result['total'] = 9999 |
| 70 | return result |
| 71 | |
| 72 | def detailContent(self, array): |
| 73 | tid = array[0] |