def load_item_cb(content, data): # Infos title_match = title_re.search(content) summary_match = summary_re.search(content) cover_match = cover_re.search(content) if None in (title_match, summary_match, cover_match): moonplayer.warn('Bilibili: Fails to get bangumi info!') return title = title_match.group(1) summary = summary_match.group(1) cover = unicode_escape(cover_match.group(1)) if not cover.startswith('http'): cover = 'http:' + cover # Urls match = srcs_re.search(content) if not match: moonplayer.warn('Bilibili: Parsing fails!') return data = json.loads(match.group(1)) srcs = [] for item in data: name = '[%s] %s' % (item['title'], item['longTitle']) url = 'https://www.bilibili.com/bangumi/play/ep' + str(item['id']) srcs.append(name) srcs.append(url) result = { 'name': title, 'image': cover, 'summary': summary, 'source': srcs } moonplayer.show_detail(result)
def load_item_cb(page, result): videos = json.loads(page)['data']['videos'] srcs = [] for i in videos: srcs.append(i['video_name']) srcs.append(i['url_html5']) result['source'] = srcs moonplayer.show_detail(result)
def load_item_cb3(page, result): match = msg_re.search(page) srcs = [] if match: msg = match.group(1) data = json.loads(msg)[u'data'] for item in data: if not item[u'need_pay']: srcs.append('%s (%s)' % (item[u'title'], item[u'source'][u'name'])) srcs.append(item[u'sample_link']) result['source'] = srcs moonplayer.show_detail(result)
def load_youku_item_cb2(page, result): srcs = [] page = page.split('(', 1)[-1][0:-2] # Remove callback function page = json.loads(page)['html'] match = yk_item_re.search(page) while match: srcs.append(match.group(2)) srcs.append('http:' + match.group(1)) match = yk_item_re.search(page, match.end(0)) # Child lists match = yk_li_re.search(page) while match: srcs.append(match.group(2)) url = 'http://list.youku.com/show/episode?callback=excited&id=%s&stage=%s' % (result['iid'], match.group(1)) srcs.append('python:res_youku_tv.parse_childlist("%s")' % url) match = yk_li_re.search(page, match.end(0)) result['source'] = srcs moonplayer.show_detail(result)
def load_item_cb(page, url): page = page.replace('\n', '') result = {} match = name_re.search(page) if match: result['name'] = match.group(1) match = pic_re.search(page) if match: result['image'] = match.group(1) match = date_re.search(page) if match: result['dates'] = [match.group(1)] match = alt_re.search(page) if match: result['alt_names'] = [match.group(1)] match = summ_re.search(page) if match: result['summary'] = match.group(1) match = more_re.search(page, match.end(0)) if match: result['summary'] += match.group(1) match = rating_re.search(page) if match: result['rating'] = float(match.group(1)) srcs = [] match = url_re.search(page) while match: (url, site, name) = match.group(1, 2, 3) srcs.append('(%s) %s' % (site, name)) srcs.append(url) match = url_re.search(page, match.end(0)) if len(srcs) == 0: # Movies match = url2_re.search(page) while match: url = match.group(1) srcs.append('source: http://' + url.split('/')[2]) srcs.append(url) match = url2_re.search(page, match.end(0)) result['source'] = srcs moonplayer.show_detail(result)
def load_item_cb(page, data): result = {} # Picture try: match = pic_re.search(page.split("drama-pic")[1]) except IndexError: match = pic_re.search(page.split("movie-pic")[1]) if match: result["image"] = match.group(1) # Name match = name_re.search(page) if match: result["name"] = match.group(1) # Rating match = rating_re.search(page) if match: result["rating"] = float(match.group(1)) # Nation / Region match = nation_re.search(page) if match: result["nations"] = [match.group(1)] # Date match = date_re.search(page) if match: result["dates"] = match.group(1).split("/") # Director match = director_re.search(page) if match: result["directors"] = match.group(1).split("/") # Alternative names match = alt_name_re.search(page) if match: result["alt_names"] = match.group(1).split("/") # Summary match = summary_re.search(page) if match: result["summary"] = match.group(1).replace(" ", " ") # Videos' urls result["source"] = list_links(page, "http://tv.sohu.com/2") moonplayer.show_detail(result)
def load_item_cb2(page, result): dates = [] match = date_re.search(page) while match: dates.append(match.group(1)) match = date_re.search(page, match.end(0)) if len(dates): result['dates'] = dates match = lang_re.search(page) if match: result['languages'] = [match.group(1)] match = length_re.search(page) if match: result['length'] = match.group(1) + ' min' match = misc_re.search(page) if match: url = match.group(0) moonplayer.get_url(url, load_item_cb3, result) else: moonplayer.show_detail(result)
def load_item_cb(content, data): if content.startswith('seasonListCallback('): content = content.replace('seasonListCallback(', '')[:-2] data = json.loads(content)['result'] srcs = [] for item in data['episodes']: name = '[%s] %s' % (item['index'], item['index_title']) srcs.append(name) srcs.append(item['webplay_url']) try: for season in data['seasons']: srcs.append(season['title']) srcs.append('python:res_bilibili.load_item("bilibili://bangumi/season/%s")' % season['season_id']) except KeyError: pass result = { 'name': data['bangumi_title'], 'image': data['cover'], 'summary': data['evaluate'], 'players': [i['actor'] for i in data['actor']], 'source': srcs } moonplayer.show_detail(result)
def load_item(url): moonplayer.show_detail(ytb_details[url])
def load_item_cb2(page, result): srcs = list_links(page, 'http://v.youku.com/v_show/id_') if len(srcs): result['source'] = srcs moonplayer.show_detail(result)