def parse_keys(self, options): self.current += 1 self.fn = '%s.p%s.%s.mp4' % (self.vid, self.qid % 10000, str(self.current)) url = 'http://vv.video.qq.com/getkey?format=%s&filename=%s&vid=%s&otype=json' % ( self.qid, self.fn, self.vid) lplayer.get_url(url, self.parse_keys_cb, options)
def parse_cb(self, page, options): #page = content.decode('GBK').encode('UTF-8') page = convert_to_utf8(page) name_match = name_re.search(page) if not name_match: lplayer.warn('Cannot get video name.') return self.name = name_match.group(1) if options & lplayer.OPT_QL_SUPER: i = 5 elif options & lplayer.OPT_QL_HIGH: i = 3 else: i = 2 vlist = [None] * 6 iid_match = iid_re.search(page) while iid_match: (pt, k) = iid_match.group(1, 2) pt = int(pt) if pt < 6: if vlist[pt] == None: vlist[pt] = [] vlist[pt].append(k) iid_match = iid_re.search(page, iid_match.end(0)) while i >= 0: if vlist[i]: self.keys = vlist[i] self.result = [] url = 'http://v2.tudou.com/f?id=' + self.keys[0] lplayer.get_url(url, self.parse_keys, options) return i -= 1 lplayer.warn('Fail!')
def parse(url, options): origin_url = url url = 'http://www.flvcd.com/parse.php?go=1&kw=' + origin_url if options & lplayer.OPT_QL_SUPER: url += '&format=super' elif options & lplayer.OPT_QL_HIGH: url += '&format=high' print url lplayer.get_url(url, parse_cb, (options, origin_url))
def search(args): if 'key' in args: url = 'http://www.soku.com/v?keyword=' + args['key'] lplayer.get_url(url, search_by_key_cb, None) return tag = args['tag'] tag_id = tags_table[tag] country = args['country'] country_id = countries_table[country] url = 'http://www.soku.com/channel/movielist_0_%i_%i_1_%i.html' % \ (tag_id, country_id, args['page']) lplayer.get_url(url, search_cb, None)
def search(args): if 'key' in args: url = 'http://www.soku.com/v?keyword=' + args['key'] lplayer.get_url(url, search_by_key_cb, None) return tag = args['tag'] tag_id = tags_table[tag] country = args['country'] country_id = countries_table[country] url = 'http://www.soku.com/channel/teleplaylist_0_%i_%i_1_%i.html' % \ (tag_id, country_id, args['page']) lplayer.get_url(url, search_cb, None)
def parse_keys(self, content, options): root = ET.fromstring(content) i = len(self.result) / 2 self.result.append('%s_%i.f4v' % (self.name, i)) self.result.append(root.text) i += 1 if i < len(self.keys): url = 'http://v2.tudou.com/f?id=' + self.keys[i] lplayer.get_url(url, self.parse_keys, options) elif options & lplayer.OPT_DOWNLOAD: lplayer.download(self.result, self.name + '.f4v') else: lplayer.play(self.result)
def parse_cb(self, page, options): match = name_re.search(page) if not match: lplayer.warn('Cannot get the video name!') return self.name = match.group(1) if self.name.isdigit(): match = cover_re.search(page) if match: self.name = match.group(1) + '-' + self.name match = vid_re.search(page) if match: self.vid = match.group(1) url = 'http://vv.video.qq.com/getinfo?otype=json&vids=' + self.vid lplayer.get_url(url, self.parse_cb2, options) else: lplayer.warn('Cannot find the vid of this video.')
def parse_cb(self, page, options): match = name_re.search(page) if not match: lplayer.warn("Cannot get the video name!") return self.name = match.group(1) if self.name.isdigit(): match = cover_re.search(page) if match: self.name = match.group(1) + "-" + self.name match = vid_re.search(page) if match: self.vid = match.group(1) url = "http://vv.video.qq.com/getinfo?otype=json&vids=" + self.vid lplayer.get_url(url, self.parse_cb2, options) else: lplayer.warn("Cannot find the vid of this video.")
def parse_cb(page, data): options = data[0] url = data[1] match = cantonese_re.search(page) if match and not '_lang=1' in lplayer.final_url: if lplayer.question('是否解析为粤语版?'): url = match.group(1) if not url.startswith('http://'): url = 'http://www.flvcd.com/' + url url += '&go=1' lplayer.get_url(url, parse_cb, data) return lplayer.warn('解析为粤语版失败!') result = parse_flvcd_page(page, None) if len(result) == 0: lplayer.warn('Cannot parse this video:\n' + url) elif options & lplayer.OPT_DOWNLOAD: lplayer.download(result, result[0]) else: lplayer.play(result)
def parse_keys(self, options): self.current += 1 self.fn = "%s.p%s.%s.mp4" % (self.vid, self.qid % 10000, str(self.current)) url = "http://vv.video.qq.com/getkey?format=%s&filename=%s&vid=%s&otype=json" % (self.qid, self.fn, self.vid) lplayer.get_url(url, self.parse_keys_cb, options)
def load_item(url): url = 'http://www.soku.com' + url lplayer.get_url(url, load_item_cb, url)
def feed(self, url, options): lplayer.get_url(url, self.parse_cb, options)
def search(keyword, page): url = 'http://www.soku.com/v?keyword=%s&type=0&ext=2&noqc=&curpage=%i' % (keyword, page) lplayer.get_url(url, search_cb, None)
def search(keyword, page): url = 'http://www.soku.com/v?keyword=%s&type=0&ext=2&noqc=&curpage=%i' % ( keyword, page) lplayer.get_url(url, search_cb, None)