def btsearchInit(sstr='',modify='0'): if sstr=='0':sstr='' if not sstr or sstr=='0' or modify=='1': sstr = keyboard(text=sstr) if not sstr: return items=[] items.append({'label': '编辑搜索关键字[COLOR FF00FFFF]%s[/COLOR]'%(six.ensure_text(sstr)), 'path': plugin.url_for('btsearchInit', sstr=six.ensure_binary(sstr), modify='1')}) items.append({'label': '按[COLOR FFFF00FF]%s[/COLOR]全搜索[COLOR FF00FFFF]%s[/COLOR]'%('相关度',six.ensure_text(sstr)), 'path': plugin.url_for('btsearch',enginestr='all',sstr=six.ensure_binary(sstr),sorttype='relevance')}) items.append({'label': '按[COLOR FFFF00FF]%s[/COLOR]全搜索[COLOR FF00FFFF]%s[/COLOR]'%('创建时间',six.ensure_text(sstr)), 'path': plugin.url_for('btsearch',enginestr='all',sstr=six.ensure_binary(sstr),sorttype='addtime')}) items.append({'label': '按[COLOR FFFF00FF]%s[/COLOR]全搜索[COLOR FF00FFFF]%s[/COLOR]'%('文件大小',six.ensure_text(sstr)), 'path': plugin.url_for('btsearch',enginestr='all',sstr=six.ensure_binary(sstr),sorttype='size')}) items.append({'label': '按[COLOR FFFF00FF]%s[/COLOR]全搜索[COLOR FF00FFFF]%s[/COLOR]'%('文件数量',six.ensure_text(sstr)), 'path': plugin.url_for('btsearch',enginestr='all',sstr=six.ensure_binary(sstr),sorttype='files')}) items.append({'label': '按[COLOR FFFF00FF]%s[/COLOR]全搜索[COLOR FF00FFFF]%s[/COLOR]'%('热度',six.ensure_text(sstr)), 'path': plugin.url_for('btsearch',enginestr='all',sstr=six.ensure_binary(sstr),sorttype='popular')}) btenginelist=nova2.initialize_engines() for btengine in btenginelist: items.append({'label': '在[COLOR FFFFFF00]%s[/COLOR]搜索[COLOR FF00FFFF]%s[/COLOR]'%(btengine,six.ensure_text(sstr)), 'path': plugin.url_for('btsearch',enginestr=btengine,sstr=six.ensure_binary(sstr),sorttype='-1'), 'thumbnail':xbmc.translatePath(os.path.join( IMAGES_PATH, 'magnet.png')) }) return items
def dbgettag(): filters['类型标签'] = [ '剧情', '喜剧', '动作', '爱情', '科幻', '动画', '悬疑', '惊悚', '恐怖', '纪录片', '短片', '情色', '同性', '音乐', '歌舞', '家庭', '儿童', '传记', '历史', '战争', '犯罪', '西部', '奇幻', '冒险', '灾难', '武侠', '古装', '运动', '戏曲', '黑色电影', '女性', '史诗', 'cult' ] filters['地区标签'] = [ '美国', '中国大陆', '香港', '台湾', '日本', '韩国', '英国', '法国', '意大利', '西班牙', '德国', '泰国', '印度', '加拿大', '澳大利亚', '俄罗斯', '波兰', '丹麦', '瑞典', '巴西', '墨西哥', '阿根廷', '比利时', '奥地利', '荷兰', '匈牙利', '土耳其', '希腊', '爱尔兰', '伊朗', '捷克' ] filters['电视剧标签'] = ['美剧', '英剧', '韩剧', '日剧', '国产剧', '港剧', '台剧', '泰剧', '动漫'] filters['年代标签'] = [ '2014', '2013', '2012', '2011', '2010', '2009', '2008', '2007', '2006', '2005', '2004', '2003', '2002', '2001', '2000', '90s', '80s', '70s', '60s', '50s', '40s', '30s' ] curyear = int(time.strftime('%Y', time.localtime(time.time()))) for intyear in range(2015, curyear + 1): filters['年代标签'].insert(0, str(intyear)) filters['自定义标签'] = six.ensure_text( plugin.get_setting('dbdeftag')).lower().split(',') sstr = '' dialog = xbmcgui.Dialog() qtyps = ['类型标签', '地区标签', '电视剧标签', '年代标签', '自定义标签', '手动输入'] sel = dialog.select('标签类型', qtyps) if sel >= 0: if sel == 5: mstr = keyboard(u'请输入标签,多个标签用空格隔开') if not mstr: return return mstr else: sel2 = dialog.select('标签类型', filters[qtyps[sel]]) if sel2 == -1: return '' return filters[qtyps[sel]][sel2]
def dbmovie(tags='', sort='U', page=0, addtag=0, scorerange='', year_range=''): sorttypes = [('近期热门', 'U'), ('标记最多', 'T'), ('评分最高', 'S'), ('最新上映', 'R')] tags = six.ensure_text(tags) if tags == '0': tags = '' if sort == '0': sort = 'U' if scorerange == '0': scorerange = '0,10' curyear = int(time.strftime('%Y', time.localtime(time.time()))) if year_range == '0': year_range = '%d,%d' % (1900, curyear) tag = '' if int(addtag) == 1: tag = dbgettag() taglist = [] if tags: taglist.extend(tags.split(',')) if tag: taglist.append(six.ensure_text(tag)) #plugin.log.error(str(taglist)) #if len(taglist)<1: return; tags = '' for t in taglist: tags += t.strip() + ',' tags = tags.strip(' ,') if sort == 'set': dialog = xbmcgui.Dialog() sel = dialog.select('排序类型', [q[0] for q in sorttypes]) if sel == -1: return sort = sorttypes[sel][1] sorttype = '' for q in sorttypes: if sort == q[1]: sorttype = q[0] break if scorerange == 'set': sellow = 0 dialog = xbmcgui.Dialog() ranges = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] sellow = dialog.select('最低评分', ranges[:10]) if sellow == -1: return if sellow >= 9: scorerange = '9,10' else: selhigh = dialog.select('最高评分', ranges[sellow + 1:]) if selhigh == -1: return scorerange = '%d,%d' % (sellow, sellow + selhigh + 1) if year_range == 'set': sellow = 0 dialog = xbmcgui.Dialog() ranges = [ '2010', '2005', '2000', '1995', '1990', '1980', '1970', '1960', '1900' ] for intyear in range(2011, curyear + 1): ranges.insert(0, str(intyear)) sellow = dialog.select('年代起', ranges) if sellow == -1: return if sellow == 0: year_range = '%d,%d' % (curyear, curyear) else: yearlow = ranges[sellow] ranges = ranges[:sellow + 1] selhigh = dialog.select('年代止', ranges) if selhigh == -1: return yearhigh = ranges[selhigh] year_range = '%s,%s' % (yearlow, yearhigh) #url='https://movie.douban.com/j/search_subjects?type=movie&tag=%s&sort=%s&page_limit=20&page_start=%s'%(tags.replace(' ','%20'),sort,str(page)) url = 'https://movie.douban.com/j/new_search_subjects?' + parse.urlencode( encode_obj({ 'tags': tags, 'sort': sort, 'range': scorerange, 'genres': '', 'start': str(int(page) * 20), 'year_range': year_range })) try: rsp = _http(url) minfo = json.loads(rsp[rsp.index('{'):]) menus = [] for m in minfo['data']: context_menu_items = [] searchtitle = m['title'].replace('第一季','s01').replace('第二季','s02').replace('第三季','s03').replace('第四季','s04').replace('第五季','s05')\ .replace('第六季','s06').replace('第七季','s07').replace('第八季','s08').replace('第九季','s09').replace('第十季','s10')\ .replace('第十一季','s11').replace('第十二季','s12').replace('第十三季','s13').replace('第十四季','s14').replace('第十五季','s15')\ .replace('第十六季','s16').replace('第十七季','s17').replace('第十八季','s18').replace('第十九季','s19').replace('第二十季','s20') context_menu_items.append(( '搜索' + colorize_label(searchtitle, color='00FF00'), 'Container.update(' + plugin.url_for('searchinit', stypes='pan,bt,db', sstr=six.ensure_binary(searchtitle), modify='1', otherargs='{}') + ')', )) listitem = ListItem( label='%s[[COLOR FFFF3333]%s[/COLOR]]' % (m['title'], m['rate']), thumbnail=m['cover'], path=plugin.url_for('dbsubject', subject=m['id']), ) if len(context_menu_items) > 0 and listitem != None: listitem.add_context_menu_items(context_menu_items) menus.append(listitem) if len(menus) <= 1: notify('豆瓣标签:无记录') return tags2 = '0' if tags: tags2 = tags if len(menus) == 20: menus.append({ 'label': '下一(第%d)页' % (int(page) + 2), 'path': plugin.url_for('dbmovie', tags=six.ensure_binary(tags2), sort=sort, page=int(page) + 1, addtag='0', scorerange=scorerange, year_range=year_range), 'thumbnail': xbmc.translatePath(os.path.join(IMAGES_PATH, 'nextpage.png')) }) menus.insert( 0, { 'label': '标签:[COLOR FFFF3333]%s[/COLOR]' % (tags), 'path': plugin.url_for('dbmovie', tags=six.ensure_binary(tags2), sort=sort, page='0', addtag='1', scorerange=scorerange, year_range=year_range) }) menus.insert( 0, { 'label': '年代:[COLOR FFFF3333]%s[/COLOR]' % (year_range), 'path': plugin.url_for('dbmovie', tags=six.ensure_binary(tags2), sort=sort, page='0', addtag='0', scorerange=scorerange, year_range='set') }) menus.insert( 0, { 'label': '评分:[COLOR FFFF3333]%s[/COLOR]' % (scorerange), 'path': plugin.url_for('dbmovie', tags=six.ensure_binary(tags2), sort=sort, page='0', addtag='0', scorerange='set', year_range=year_range) }) menus.insert( 0, { 'label': '排序:[COLOR FFFF3333]%s[/COLOR]' % (sorttype), 'path': plugin.url_for('dbmovie', tags=six.ensure_binary(tags2), sort='set', page='0', addtag='0', scorerange=scorerange, year_range=year_range) }) #plugin.set_content('movies') comm.setthumbnail = True return menus except Exception as e: xbmc.log(msg=format_exc(), level=xbmc.LOGERROR) notify(str(e)) return
def dbsubject(subject): menus = [] try: rsp = _http('https://movie.douban.com/subject/' + subject + '/', referer='https://www.douban.com/link2/') #plugin.log.error(rsp) year = title = title2 = thumb = summary = '' m = re.search(r"title\x3E\s*(?P<title>.*?)\s*\x3C\x2Ftitle", rsp, re.DOTALL) if m: title = m.group("title") title = title[0:title.index('(')].strip() rtxt = r'dale_movie_subject_top_icon.*?itemreviewed\x22\x3E(?P<title>.*?)\x3C.*?\x22year\x22\x3E(?P<year>.*?)\x3C.*?mainpic.*?img\s+src\x3D\x22(?P<thumb>.*?)\x22' m = re.search(rtxt, rsp, re.DOTALL) if m: year = m.group('year').strip(')(') title2 = html_parser.HTMLParser().unescape(m.group('title')) title2 = title2.replace(title, '').strip() thumb = m.group('thumb') rtxt = r'summary.*?\x3E\s*(?P<summary>.*?)\s*\x3C' m = re.search(rtxt, rsp, re.DOTALL) if m: summary = m.group('summary') rtxt = r'div\s+id\x3D\x22info\x22\x3E\s+(?P<info>.*?)\s+\x3C\x2Fdiv' m = re.search(rtxt, rsp, re.DOTALL) genres = [] areas = [] names = [] if m: info = m.group('info') m = re.search(r'类型.*?(?P<strs>\x3Cspan.*?span\x3E\s*)\x3Cbr', info, re.DOTALL) if m: strs = m.group('strs') for m in re.finditer("\x3E(?P<gen>[^\x3E\x3C]+?)\x3C\x2Fspan", strs, re.DOTALL): genres.append(m.group('gen')) m = re.search(r'制片国家.*?span\x3E\s*(?P<strs>.*?)\x3Cbr', info, re.DOTALL) if m: strs = m.group('strs') for area in strs.split('/'): areas.append(area.strip()) m = re.search(r'又名.*?span\x3E\s*(?P<strs>.*?)\x3Cbr', info, re.DOTALL) if m: strs = html_parser.HTMLParser().unescape(m.group('strs')) for othtitle in strs.split('/'): names.append(othtitle.strip()) celes = [] rtxt = r"avatar[^\n]*?background\x2Dimage[^\n]*?url\x28(?P<img>[^\x2C\s]*?)\x29\x22\x3E.*?celebrity\x2F(?P<id>[0-9]+)\x2F.*?name\x22\x3E(?P<name>.*?)\x3C\x2Fa\x3E.*?title\x3D\x22(?P<role>.*?)\x22\x3E" for m in re.finditer(rtxt, rsp, re.DOTALL): celes.append({ 'id': m.group('id'), 'name': m.group('name'), 'img': m.group('img'), 'role': m.group('role'), }) tags = [] m = re.search("\x22tags-body\x22\x3E.*?\x3C\x2Fdiv\x3E", rsp, re.DOTALL) if m: tagsg = m.group() for m in re.finditer("\x2Ftag\x2F.*?\x3E(?P<tag>.*?)\x3C", tagsg, re.DOTALL): tags.append(m.group('tag')) comm.moviepoint['group'] = 'db' comm.moviepoint['title'] = title comm.moviepoint['thumbnail'] = thumb menus.append({ 'label': '[COLOR FFFF2222]简介:[/COLOR]%s' % summary, 'path': plugin.url_for('dbsummary', summary=six.ensure_binary(summary)), 'thumbnail': thumb }) menus.append({ 'label': comm.colorize_label('预告片', None, color='32FF94'), 'path': plugin.url_for('dbclips', subject=subject), 'thumbnail': xbmc.translatePath(os.path.join(IMAGES_PATH, 'movies.png')) }) menus.append({ 'label': comm.colorize_label('剧照', None, color='32FF94'), 'path': plugin.url_for('dbphotos', subject=subject, pictype='S', page=0), 'thumbnail': xbmc.translatePath(os.path.join(IMAGES_PATH, 'picture.png')) }) strlist = [] strlist.append(title) strlist.append(title + ' ' + year) if title2 != '': strlist.append(title2 + ' ' + year) for aka in names: if aka.find('(') >= 0 and aka.find(')') >= 0: aka = aka.replace(aka[aka.find('('):aka.find(')') + 1], '') strlist.append(aka + ' ' + year) #去重 news_strlist = list(set(strlist)) news_strlist.sort(key=strlist.index) for sstr in news_strlist: ''' context_menu_items=[] context_menu_items.append(('搜索'+colorize_label(sstr, color='00FF00'), 'Container.update('+plugin.url_for('searchinit',stypes='pan,bt',sstr=six.ensure_binary(sstr),modify='1',otherargs='{}')+')',)) listitem=ListItem(label='BT:[COLOR FF00FFFF]%s[/COLOR]' % (six.ensure_text(sstr)), label2=None, icon=None, thumbnail=xbmc.translatePath( os.path.join( IMAGES_PATH, 'magnet.png') ), path=plugin.url_for('btsearchInit', sstr=six.ensure_binary(sstr), modify='0',ext=comm.moviepoint)) if len(context_menu_items)>0 and listitem!=None: listitem.add_context_menu_items(context_menu_items) menus.append(listitem) ''' sstr = six.ensure_text(sstr).replace('第一季','s01').replace('第二季','s02').replace('第三季','s03').replace('第四季','s04').replace('第五季','s05')\ .replace('第六季','s06').replace('第七季','s07').replace('第八季','s08').replace('第九季','s09').replace('第十季','s10')\ .replace('第十一季','s11').replace('第十二季','s12').replace('第十三季','s13').replace('第十四季','s14').replace('第十五季','s15')\ .replace('第十六季','s16').replace('第十七季','s17').replace('第十八季','s18').replace('第十九季','s19').replace('第二十季','s20') menus.append( ListItem(label='搜索:[COLOR FF00FFFF]%s[/COLOR]' % (sstr), label2=None, icon=None, thumbnail=xbmc.translatePath( os.path.join(IMAGES_PATH, 'disksearch.png')), path=plugin.url_for('searchinit', stypes='pan,bt', sstr=six.ensure_binary(sstr), modify='1', otherargs='{}'))) for cast in celes: thumb = cast['img'] cast['name'] + ' ' + cast['role'] menus.append({ 'label': '[COLOR FFFF66AA]%s[/COLOR]%s' % (cast['name'], cast['role']), 'path': plugin.url_for('dbactor', sstr=six.ensure_binary(cast['id']), sort='time', page=0), 'context_menu': [( '搜索' + colorize_label(cast['name'], color='00FF00'), 'Container.update(' + plugin.url_for('searchinit', stypes='pan,bt,db', sstr=six.ensure_binary(cast['name']), modify='1', otherargs='{}') + ')', )], 'thumbnail': thumb }) menus.append({ 'label': '年代:[COLOR FF00AAFF]%s[/COLOR]' % (year), 'thumbnail': xbmc.translatePath(os.path.join(IMAGES_PATH, 'tag.png')), 'path': plugin.url_for('dbmovie', tags=six.ensure_binary(year), sort='U', page='0', addtag='0', scorerange='0', year_range='0') }) for genre in genres: menus.append({ 'label': '类型:[COLOR FF00AAFF]%s[/COLOR]' % (genre), 'thumbnail': xbmc.translatePath(os.path.join(IMAGES_PATH, 'tag.png')), 'path': plugin.url_for('dbmovie', tags=six.ensure_binary(genre), sort='U', page='0', addtag='0', scorerange='0', year_range='0') }) for area in areas: menus.append({ 'label': '地区:[COLOR FF00AAFF]%s[/COLOR]' % (area), 'thumbnail': xbmc.translatePath(os.path.join(IMAGES_PATH, 'tag.png')), 'path': plugin.url_for('dbmovie', tags=six.ensure_binary(area), sort='U', page='0', addtag='0', scorerange='0', year_range='0') }) for tag in tags: menus.append({ 'label': '标签:[COLOR FF00AAFF]%s[/COLOR]' % (tag), 'thumbnail': xbmc.translatePath(os.path.join(IMAGES_PATH, 'tag.png')), 'path': plugin.url_for('dbmovie', tags=six.ensure_binary(tag), sort='U', page='0', addtag='0', scorerange='0', year_range='0') }) return menus except Exception as e: xbmc.log(msg=format_exc(), level=xbmc.LOGERROR) plugin.log.error(str(e)) return
def freepv(movieid=''): videourl = '' subpath = xbmc.translatePath(os.path.join(__cwd__, 'sample.m3u8')) if movieid[0:3] == 'bb,': (bb, studio, movid) = six.ensure_text(movieid).split(',') if studio == 'HEYZO': ''' (unuse,movid2)=movid.split('-') videourl=subpath videodata=_http('http://hls.heyzo.com/sample/3000/%s/ts.sample.mp4.m3u8'%(movid2),referer='http://www.heyzo.com/js_v2/vendor/jwplayer/7.12.8/jwplayer.flash.swf') with open(subpath, "wb") as sampleFile: for line in videodata.splitlines(): if line[0:1]=='/': sampleFile.write('http://hls.heyzo.com'+line+os.linesep) else: sampleFile.write(line+os.linesep) sampleFile.close() ''' (unuse, movid2) = movid.split('-') videourl = 'http://sample.heyzo.com/contents/3000/%s/sample.mp4' % ( movid2) elif studio == '一本道': videourl = 'http://smovie.1pondo.tv/sample/movies/%s/1080p.mp4' % ( movid) elif studio == 'カリビアンコム': videourl = 'https://m.caribbeancom.com/samplemovies/%s/1080p.mp4' % ( movid) elif studio == '天然むすめ': videourl = 'http://smovie.10musume.com/sample/movies/%s/1080p.mp4' % ( movid) elif studio == 'パコパコママ': videourl = 'http://smovie.pacopacomama.com/sample/movies/%s/1080p.mp4' % ( movid) elif studio == '東京熱': videodata = _http('https://www.tokyo-hot.com/product/?q=%s' % (movid)) match = re.search( r'[\x22\x27]\x2Fproduct\x2F(?P<no>[^\s]+?)\x2F[\x22\x27]', videodata, re.DOTALL | re.MULTILINE) if match: movid2 = match.group('no') #notify(movid2) videodata = _http('https://www.tokyo-hot.com/product/%s/' % (movid2)) match2 = re.search( r'mp4[\x22\x27]\s+src\s*=\s*[\x22\x27](?P<src>.*?mp4)[\x22\x27]', videodata, re.DOTALL | re.MULTILINE) if match2: videourl = match2.group('src') #if studio=='キャットウォーク': else: #videourl='http://www.aventertainments.com/newdlsample.aspx?site=ppv&whichone=ppv/mp4/DL%s.mp4|Referer=http://www.aventertainments.com/product_lists.aspx'%(movid) videourl = 'https://ppvclips03.aventertainments.com/00m3u8/%s/%s.m3u8' % ( movid, movid) if not url_is_alive(videourl): videourl = 'https://ppvclips03.aventertainments.com/01m3u8/%s/%s.m3u8' % ( movid, movid) #if not comm.url_is_alive(videourl): # videourl='' else: for mid in [movieid, movieid[0:-5] + movieid[-3:]]: id1c = mid[0:1] id3c = mid[0:3] for stm in [ '_dmb_w', '_dm_w', '_sm_w', '_dmb_s', '_dm_s', '_sm_s' ]: videourltemp = 'http://cc3001.dmm.co.jp/litevideo/freepv/%s/%s/%s/%s%s.mp4' % ( id1c, id3c, mid, mid, stm) #xbmc.log(videourltemp) if url_is_alive(videourltemp): videourl = videourltemp break if videourl != '': break if videourl != '': plugin.set_resolved_url(videourl) else: notify('未找到预告片') return
def javdetail(qbbb='qb', movieno='0', id='0', title='0'): menus = [] url = '%s/%s' % (javbusurl['base'], movieno) if qbbb == 'om': url = '%s/%s' % (javbusurl['om'], movieno) try: rsp = _http(url) match = re.search( "var\x20gid\x20*=\x20*(?P<gid>.*?);.*?var\x20uc\x20=\x20(?P<uc>.*?);", rsp, re.DOTALL | re.MULTILINE) except: xbmc.log(msg=format_exc(), level=xbmc.LOGERROR) notify('片片信息获取失败') xbmc.log(msg=format_exc(), level=xbmc.LOGERROR) return if match: gid = match.group('gid') uc = match.group('uc') if qbbb != 'om': if uc == '0': qbbb = 'qb' if uc == '1': qbbb = 'bb' menus.append({ 'label': '[COLOR FF00FFFF]自带磁力[/COLOR]', 'path': plugin.url_for('javmagnet', qbbb=qbbb, gid=gid, uc=uc), 'thumbnail': xbmc.translatePath(os.path.join(IMAGES_PATH, 'magnet.jpg')) }) context_menu_items = [] ''' context_menu_items.append(('搜索'+colorize_label(id, color='00FF00'), 'Container.update('+plugin.url_for('searchinit',stypes='pan,bt',sstr=six.ensure_binary(id),modify='1',otherargs='{}')+')',)) listitem=ListItem(label='BT:[COLOR FF00FFFF]%s[/COLOR]' % (id), thumbnail=xbmc.translatePath( os.path.join( IMAGES_PATH, 'magnet.jpg') ), path=plugin.url_for('btsearchInit', sstr=id, modify='0'),) if len(context_menu_items)>0 and listitem!=None: listitem.add_context_menu_items(context_menu_items) menus.append(listitem) title=six.ensure_text(title) context_menu_items=[] context_menu_items.append((six.ensure_binary('搜索'+colorize_label(title, color='00FF00')), 'Container.update('+plugin.url_for('searchinit',stypes='pan,bt',sstr=six.ensure_binary(title),modify='1',otherargs='{}')+')',)) listitem=ListItem(label='BT:[COLOR FF00FFFF]%s[/COLOR]' % (title), thumbnail=xbmc.translatePath( os.path.join( __cwd__, 'magnet.jpg') ), path=plugin.url_for('btsearchInit', sstr=six.ensure_binary(title), modify='0'),) if len(context_menu_items)>0 and listitem!=None: listitem.add_context_menu_items(context_menu_items) menus.append(listitem) ''' menus.append( ListItem( label='搜索:[COLOR FF00FFFF]%s[/COLOR]' % (id), thumbnail=xbmc.translatePath( os.path.join(IMAGES_PATH, 'disksearch.jpg')), path=plugin.url_for('searchinit', stypes='pan,bt', sstr=six.ensure_binary(id), modify='1', otherargs='{}'), )) menus.append( ListItem( label='搜索:[COLOR FF00FFFF]%s[/COLOR]' % (six.ensure_text(title)), thumbnail=xbmc.translatePath( os.path.join(IMAGES_PATH, 'disksearch.jpg')), path=plugin.url_for('searchinit', stypes='pan,bt', sstr=six.ensure_binary(title), modify='1', otherargs='{}'), )) releech = '"bigImage"\x20href="(?P<mainimg>.*?)"><' leech = re.compile(releech, re.S) movieid = '' movieid2 = '' for match in leech.finditer(rsp): if qbbb == 'qb': if movieid == '': matchmovid = re.search(r'video/(?P<movieid>.*?)/', match.group('mainimg'), re.DOTALL | re.MULTILINE) if matchmovid: movieid = matchmovid.group('movieid') if movieid2 == '': matchmovid2 = re.search(r'cover/(?P<movid2>.+?)_', match.group('mainimg'), re.DOTALL | re.MULTILINE) if matchmovid2: movieid2 = matchmovid2.group('movid2') menus.append({ 'label': '封面图', 'path': plugin.url_for('showpic', imageurl=match.group('mainimg')), 'thumbnail': match.group('mainimg'), }) comm.moviepoint['group'] = 'javbus' comm.moviepoint['title'] = title comm.moviepoint['thumbnail'] = match.group('mainimg') #notify(movieid+','+movieid2) releech = '</span>\x20<a\x20href="%s/(?P<filter_type>[a-z]+?)/(?P<filter_key>[0-9a-z]+?)">(?P<filter_name>.*?)</a>' % ( javbusurl[qbbb]) leech = re.compile(releech, re.S) for match in leech.finditer(rsp): filtertype = '' filterkey = match.group('filter_key') if filterkey and filterkey != '0': filtername = match.group('filter_name') if match.group('filter_type') == 'director': filtertype = match.group('filter_type') filtertypename = '导演' if match.group('filter_type') == 'studio': filtertype = match.group('filter_type') filtertypename = '制作商' #if filtername in ['HEYZO','一本道','カリビアンコム','天然むすめ','キャットウォーク']: if qbbb == 'bb' and filtername not in ['熟女倶楽部', 'メス豚']: movieid = 'bb,' + filtername + ',' + movieno if match.group('filter_type') == 'label': filtertype = match.group('filter_type') filtertypename = '发行商' if match.group('filter_type') == 'series': filtertype = match.group('filter_type') filtertypename = '系列' if filtertype: menus.append({ 'label': '%s:%s' % (filtertypename, filtername), 'path': plugin.url_for('javlist', qbbb=qbbb, filtertype=filtertype, filterkey=filterkey, page=1), 'context_menu': [( '搜索' + colorize_label(filtername, color='00FF00'), 'Container.update(' + plugin.url_for('searchinit', stypes='pan,bt,jav', sstr=six.ensure_binary(filtername), modify='1', otherargs='{}') + ')', )] }) releech = '"genre"><a\x20href="%s/(?P<filter_type>[a-z]+?)/(?P<filter_key>[0-9a-z]+?)">(?P<filter_name>.*?)</a>' % ( javbusurl[qbbb]) releech = '<a\x20href="%s/(?P<filter_type>[a-z]+?)/(?P<filter_key>[0-9a-z]+?)">(?P<filter_name>.*?)</a>' % ( javbusurl[qbbb]) leech = re.compile(releech, re.S) for match in leech.finditer(rsp): filtertype = '' filterkey = match.group('filter_key') if filterkey and filterkey != '0': filtername = match.group('filter_name') if match.group('filter_type') == 'genre': filtertype = match.group('filter_type') filtertypename = '类别' if filtertype: menus.append({ 'label': '%s:%s' % (filtertypename, filtername), 'path': plugin.url_for('javlist', qbbb=qbbb, filtertype=filtertype, filterkey=filterkey, page=1), 'context_menu': [( '搜索' + colorize_label(filtername, color='00FF00'), 'Container.update(' + plugin.url_for('searchinit', stypes='pan,bt,jav', sstr=six.ensure_binary(filtername), modify='1', otherargs='{}') + ')', )] }) releech = 'avatar-box.*?href="%s/star/(?P<starid>.*?)">.*?src="(?P<starimg>.*?)".*?<span>(?P<starname>.*?)</span>' % ( javbusurl[qbbb]) if qbbb == 'om': releech = 'href="%s/star/(?P<starid>[0-9a-z]{1,10}?)"\s*?target="_blank"><img\s*?src="(?P<starimg>.*?)".*?title.*?title.*?_blank">(?P<starname>.*?)</a>' % ( javbusurl[qbbb]) leech = re.compile(releech, re.S) for match in leech.finditer(rsp): context_menu_items = [] context_menu_items.append(( '搜索' + colorize_label(match.group('starname'), color='00FF00'), 'Container.update(' + plugin.url_for('searchinit', stypes='pan,bt,jav', sstr=six.ensure_binary(match.group('starname')), modify='1', otherargs='{}') + ')', )) listitem = ListItem( label='优优:%s' % (match.group('starname')), thumbnail=match.group('starimg'), path=plugin.url_for('javlist', qbbb=qbbb, filtertype='star', filterkey=match.group('starid'), page=1), ) if len(context_menu_items) > 0 and listitem != None: listitem.add_context_menu_items(context_menu_items) menus.append(listitem) releech = 'sample-box.*?href="(?P<sampleimg>.*?)">.*?src="(?P<thumbimg>.*?)"' if qbbb == 'om': releech = 'href="(?P<sampleimg>[^"]*?.jpg)"><img\x20src="(?P<thumbimg>[^"]*?thumb.jpg)"' leech = re.compile(releech, re.S) for match in leech.finditer(rsp): if qbbb == 'qb': if movieid == '': matchmovid = re.search(r'video/(?P<movieid>.*?)/', match.group('sampleimg'), re.DOTALL | re.MULTILINE) if matchmovid: movieid = matchmovid.group('movieid') menus.append({ 'label': '样品图', 'path': plugin.url_for('showpic', imageurl=match.group('sampleimg')), 'thumbnail': match.group('thumbimg'), }) #notify(movieid2) if movieid == '' and qbbb == 'qb' and movieid2 != '': cururl = 'https://javzoo.com' tellmeurl = 'https://tellme.pw/avmoo' try: rsp = _http(tellmeurl) matchcururl = re.search( r'strong\x3E\s*\x3Ca\s+href\x3D\x22(?P<cururl>http[s]*\x3A\x2f\x2f[a-zA-Z\x2E]+)\x22', rsp, re.IGNORECASE | re.DOTALL | re.MULTILINE) if matchcururl: cururl = matchcururl.group('cururl') except: xbmc.log(msg=format_exc(), level=xbmc.LOGERROR) cururl = 'https://javzoo.com' #url='%s/cn/search/%s'%(cururl,movieid2) url = '%s/cn/search/%s' % (cururl, movieno) try: rsp = _http(url) #matchmovid = re.search(r'bigImage.*?video/(?P<movieid>.*?)/', rsp, re.DOTALL | re.MULTILINE) matchmovid = re.search(r'digital\x2Fvideo\x2F(?P<movieid>.*?)\x2F', rsp, re.DOTALL | re.MULTILINE) if matchmovid: movieid = matchmovid.group('movieid') #leech = re.compile(r'sample-box.*?href="(?P<sampleimg>[^"]*?.jpg)".*?src="(?P<thumbimg>[^"]*?.jpg)"', re.S) # for match in leech.finditer(rsp): # menus.append({'label':'样品图', # 'path': plugin.url_for('showpic', imageurl=match.group('sampleimg')), # 'thumbnail':match.group('thumbimg'),}) except: xbmc.log(msg=format_exc(), level=xbmc.LOGERROR) movieid = '' if movieid == '' and qbbb == 'qb': movieid = id.replace('-', '00').lower() if movieid != '': menus.insert( 1, { 'label': '预告片', 'path': plugin.url_for('freepv', movieid=six.ensure_binary(movieid)), 'thumbnail': xbmc.translatePath(os.path.join(IMAGES_PATH, 'movies.png')), 'is_playable': True, 'info_type': 'video', 'info': { 'title': six.ensure_text(title) } }) comm.setthumbnail = True return menus