Esempio n. 1
0
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
Esempio n. 2
0
def javstarlist(qbbb='qb', page=1):
    filter = '/actresses'
    pagestr = ''
    if int(page) > 1:
        pagestr = '/' + str(page)
    url = '%s%s%s' % (javbusurl[qbbb], filter, pagestr)
    try:
        rsp = _http(url)
        releech = 'avatar-box.*?href="%s/star/(?P<starid>.*?)">.*?src="(?P<starimg>.*?)".*?<span>(?P<starname>.*?)</span>' % (
            javbusurl[qbbb])
        # if qbbb=='om':
        # releech=r'star-frame2.*?href="%s/star/(?P<starid>.*?)".*?src="(?P<starimg>.*?)".*?title="(?P<starname>.*?)"'%(javbusurl[qbbb])
        leech = re.compile(releech, re.S)
        menus = []
        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',
                               sstr=six.ensure_binary(match.group('starname')),
                               modify='1',
                               otherargs='{}') + ')',
            ))

            listitem = ListItem(
                label='优优:%s' % (match.group('starname')),
                thumbnail=parse.urljoin(javbusurl[qbbb],
                                        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)
        strnextpage = str(int(page) + 1)
        strnextpage = '/' + strnextpage + '">' + strnextpage + '</a>'
        if rsp.find(strnextpage) >= 0:
            menus.append({
                'label':
                '下一页',
                'path':
                plugin.url_for('javstarlist', qbbb=qbbb, page=int(page) + 1),
                'thumbnail':
                xbmc.translatePath(os.path.join(IMAGES_PATH, 'nextpage.png'))
            })
        comm.setthumbnail = True
        return menus
    except:
        notify('女优列表获取失败')
        xbmc.log(msg=format_exc(), level=xbmc.LOGERROR)
        return
Esempio n. 3
0
def javmagnet(qbbb='qb', gid='0', uc='0'):
    menus = []
    baseurl = javbusurl['base']
    if qbbb == 'om':
        baseurl = javbusurl['om']


#try:
    rspmagnet = _http('%s/ajax/uncledatoolsbyajax.php?gid=%s&uc=%s&floor=1' %
                      (baseurl, gid, uc),
                      referer=baseurl)
    #xbmc.log(rspmagnet)
    leechmagnet = re.compile(
        'onmouseover.*?href="(?P<magnet>magnet.*?)">\s*(?P<title>.*?)\s*</a>.*?href.*?">\s*(?P<filesize>.*?)\s*</a>.*?href.*?">\s*(?P<createdate>.*?)\s*</a>',
        re.S)
    #if qbbb=='om':
    #	leechmagnet = re.compile(r'onmouseover.*?\x29">\s*(?P<title>.*?)\s*</td>.*?">\s*(?P<filesize>.*?)\s*</td>.*?">\s*(?P<createdate>.*?)\s*</td>.*?href="(?P<magnet>magnet.*?)">',  re.S)
    for match in leechmagnet.finditer(rspmagnet):

        magnet = match.group('magnet')
        title = match.group('title')
        title = re.sub("<a\x20.*?>", "|", title)
        filesize = match.group('filesize')
        createdate = match.group('createdate')

        filemsg = '大小:' + filesize + '  创建时间:' + createdate

        listitem = ListItem(label=comm.colorize_label(title, 'bt'),
                            label2=filesize,
                            icon=None,
                            thumbnail=xbmc.translatePath(
                                os.path.join(IMAGES_PATH, 'magnet.jpg')),
                            path=plugin.url_for(
                                'execmagnet',
                                url=six.ensure_binary(magnet),
                                title=six.ensure_binary(title),
                                msg=six.ensure_binary(filemsg)))

        menus.append(listitem)
    return menus
    #except:
    notify('自带磁力获取失败')
    return
Esempio n. 4
0
def dbtop(page):
    page = int(page)
    pc = page * 25
    try:
        rsp = _http('http://movie.douban.com/top250?start={0}'.format(pc))
        mstr = r'class="item".*?href="(.*?)".*?alt="(.*?)" src="(.*?)".*?<p class="">\s+(.*?)</p>'
        mpatt = re.compile(mstr, re.S)
        mitems = mpatt.findall(rsp)
        menus = []
        for s, i in enumerate(mitems):
            searchtitle = i[1].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({
                'label':
                '{0}. {1}[{2}]'.format(
                    s + pc + 1,
                    i[1], ''.join(i[3].replace('&nbsp;', ' ').replace(
                        '<br>', ' ').replace('\n', ' ').split(' '))),
                'path':
                plugin.url_for('dbsubject',
                               subject=i[0][i[0].find('subject') + 7:].replace(
                                   '/', '')),
                'thumbnail':
                i[2],
                'context_menu': [(
                    '搜索' + colorize_label(searchtitle, color='00FF00'),
                    'Container.update(' +
                    plugin.url_for('searchinit',
                                   stypes='pan,bt',
                                   sstr=six.ensure_binary(i[1]),
                                   modify='1',
                                   otherargs='{}') + ')',
                )],
                #'thumbnail': i[2].replace('ipst','lpst').replace('img3.douban.com','img4.douban.com'),
            })

        if page < 9:
            menus.append({
                'label':
                '下一页',
                'path':
                plugin.url_for('dbtop', page=page + 1),
                'thumbnail':
                xbmc.translatePath(os.path.join(IMAGES_PATH, 'nextpage.png'))
            })

        #plugin.set_content('movies')
        comm.setthumbnail = True
        return menus
    except:
        xbmc.log(msg=format_exc(), level=xbmc.LOGERROR)
        return
Esempio n. 5
0
def dbtypetop(dbtype='1', start=0):
    url = 'https://movie.douban.com/j/chart/top_list?type=%s&interval_id=100:90&action=&start=%s&limit=20' % (
        dbtype, str(start))
    try:
        rsp = _http(url)

        #notify('a')
        minfo = json.loads(rsp[rsp.index('['):])

        menus = []
        plugin.log.error(minfo)
        for m in minfo:
            #notify(m)
            menus.append({
                'label':
                '%s[%s]' % (m['title'], m['score']),
                'path':
                plugin.url_for('dbsubject', subject=m['id']),
                'thumbnail':
                m['cover_url'],
                'context_menu': [(
                    '搜索' + colorize_label(m['title'], color='00FF00'),
                    'Container.update(' +
                    plugin.url_for('searchinit',
                                   stypes='pan,bt',
                                   sstr=six.ensure_binary(m['title']),
                                   modify='1',
                                   otherargs='{}') + ')',
                )],
            })

        if not len(menus) > 1: return
        if len(menus) == 20:
            menus.append({
                'label':
                '下一页',
                'path':
                plugin.url_for('dbtypetop',
                               dbtype=dbtype,
                               start=int(start) + 20),
                'thumbnail':
                xbmc.translatePath(os.path.join(IMAGES_PATH, 'nextpage.png'))
            })

        #plugin.set_content('movies')
        comm.setthumbnail = True
        return menus
    except:
        xbmc.log(msg=format_exc(), level=xbmc.LOGERROR)
        return
Esempio n. 6
0
def btsearch(enginestr,sstr,sorttype):
    if not sstr or sstr=='0':
        return
    max=int(plugin.get_setting('btmaxresult'))
    max=(max+1)*20
    items=[]
    if enginestr!='all' and sorttype=='-1':
        engineinfo=nova2.getengineinfo(enginestr)
        supportsort=engineinfo['support_sort']
        if len(supportsort)>0:
            sortkeys={'relevance':'相关度','addtime':'创建时间','size':'文件大小','files':'文件数量','popular':'热度',}
            dialog = xbmcgui.Dialog()
            sortselectlist=[]
            for s in supportsort:
                sortselectlist.append(sortkeys[s])
            sorttype=dialog.select(engineinfo['name']+'选择排序类型',sortselectlist)
            if sorttype==-1:
                return None
            sorttype=supportsort[int(sorttype)]
            #notify(sorttype)
    result=nova2.search(enginestr,sstr,sorttype,maxresult=max)
    msg='共找到%d条磁力链' % (len(result))
    notify(msg)

    for res_dict in result:
        title='[COLOR FF00FFFF]'+res_dict['size']+'[/COLOR]'+'[COLOR FFCCFFCC]'+res_dict['date'][:10]+'[/COLOR]'+res_dict['name']
        filemsg ='大小:'+res_dict['size']+'  创建时间:'+res_dict['date']
        listitem=ListItem(label=comm.colorize_label(title, 'bt'), 
            label2=res_dict['size'], icon=None, thumbnail=None, 
            path=plugin.url_for('execmagnet',url=res_dict['link'],
            title=six.ensure_binary(title),msg=six.ensure_binary(filemsg)))
        #listitem.set_info('picture', {'size': anySizeToBytes(res_dict['size'])})
        context_menu_items=[] 
        if(list=='other'):
            titletype=title
        items.append(listitem)
    return items
Esempio n. 7
0
def rspmenus(rsp):
    menus = []
    try:
        rtxt = r'tr class="item".*?nbg"\x20href="(.*?)".*?src="(.*?)"\s+.*?alt="(.*?)".*?class="pl">(.*?)</p>.*?clearfix">(.*?)<span class="pl">'
        patt = re.compile(rtxt, re.S)
        mitems = patt.findall(rsp)

        if not mitems: return []

        for s, i in enumerate(mitems):
            rating = '-'
            if i[4].find('"rating_nums">') > 0:
                rating = i[4][i[4].find('"rating_nums">') +
                              14:i[4].rfind('</span>')]
            menus.append({
                'label':
                '{0}. {1}[{2}][{3}]'.format(s, i[2], rating, i[3]),
                'path':
                plugin.url_for('dbsubject',
                               subject=i[0][i[0].find('subject') + 7:].replace(
                                   '/', '')),
                'context_menu': [(
                    '搜索' + colorize_label(i[2], color='00FF00'),
                    'Container.update(' +
                    plugin.url_for('searchinit',
                                   stypes='pan,bt',
                                   sstr=six.ensure_binary(i[2]),
                                   modify='1',
                                   otherargs='{}') + ')',
                )],
                'thumbnail':
                i[1],
            })
            #'thumbnail': i[1].replace('ipst','lpst').replace('img3.douban.com','img4.douban.com'),})
        return menus
    except:
        xbmc.log(msg=format_exc(), level=xbmc.LOGERROR)
        return []
Esempio n. 8
0
def dbactor(sstr, sort='time', page=0):
    try:
        url = 'https://movie.douban.com/celebrity/%s/' % (sstr)
        rsp = _http(url)
        celename = celeinfo = celeimg = summary = ''
        m = re.search(
            r"\x22nbg\x22\s+title\x3D\x22(?P<celename>.*?)\x22\s+href\x3D\x22(?P<celeimg>.*?)\x22",
            rsp, re.DOTALL)
        if m:
            celename = m.group("celename")
            celeimg = m.group("celeimg")
        rtxt = r'(?P<celeinfo>\x3Cli\x3E\s+\x3Cspan\x3E性别.+?)\x3C\x2Ful\x3E'
        m = re.search(rtxt, rsp, re.DOTALL)
        if m:
            celeinfo = m.group('celeinfo')
            celeinfo = re.sub(r'\x3C.*?\x3E', '', celeinfo)
            celeinfo = re.sub(r'\x3A\s+', '\x3A', celeinfo, re.DOTALL)
            celeinfo = celeinfo.replace(' ', '')
            celeinfo = re.sub(r'\s+', '\r\n', celeinfo, re.DOTALL)
            #plugin.log.error(celename)
        m = re.search(r'影人简介.*?\x22bd\x22\x3E(?P<summary>.*?)\x3C', rsp,
                      re.DOTALL)
        if m:
            summary = m.group("summary")
        m = re.search(r'\x22all\s+hidden\x22\x3E(?P<summary>.*?)\x3C', rsp,
                      re.DOTALL)
        if m:
            summary = m.group("summary")
        menus = []
        menus.append({
            'label':
            '简介:[COLOR FFFF2222]%s[/COLOR]' % celename,
            'path':
            plugin.url_for('dbsummary',
                           summary=six.ensure_binary(celename + celeinfo +
                                                     summary)),
            'thumbnail':
            celeimg
        })
        menus.append({
            'label':
            comm.colorize_label('影人图片', None, color='32FF94'),
            'path':
            plugin.url_for('celephotos', cele=six.ensure_binary(sstr), page=0),
            'thumbnail':
            xbmc.translatePath(os.path.join(IMAGES_PATH, 'picture.png'))
        })
        if sort == 'time':
            menus.append({
                'label':
                '按[COLOR FFFF3333]评分[/COLOR]排序',
                'path':
                plugin.url_for('dbactor',
                               sstr=six.ensure_binary(sstr),
                               sort='vote',
                               page='0')
            })
        else:
            menus.append({
                'label':
                '按[COLOR FFFF3333]时间[/COLOR]排序',
                'path':
                plugin.url_for('dbactor',
                               sstr=six.ensure_binary(sstr),
                               sort='time',
                               page='0')
            })
        url = 'https://movie.douban.com/celebrity/%s/movies?start=%d&format=pic&sortby=%s&' % (
            sstr, int(page) * 10, sort)
        rsp = _http(url)
        rtxt = r'subject\x2F(?P<id>[0-9]+)\x2F.*?img\ssrc\x3D\x22(?P<imgurl>.*?)\x22.*?title\x3D\x22(?P<title>.*?)\x22.*?\x22star\s.*?span\x3E(?P<rate>.*?)\x3C\x2Fdiv'
        for sub in re.finditer(rtxt, rsp, re.DOTALL):
            rate = ''
            mrate = re.search(r'\x3Cspan\x3E(?P<rate>[\x2E0-9]+?)\x3C',
                              sub.group('rate').strip(), re.DOTALL)
            if mrate:
                rate = mrate.group('rate')

            context_menu_items = []
            context_menu_items.append((
                '搜索' + colorize_label(sub.group('title'), color='00FF00'),
                'Container.update(' +
                plugin.url_for('searchinit',
                               stypes='pan,bt,db',
                               sstr=six.ensure_binary(sub.group('title')),
                               modify='1',
                               otherargs='{}') + ')',
            ))

            listitem = ListItem(
                label='%s[[COLOR FFFF3333]%s[/COLOR]]' %
                (sub.group('title'), rate),
                thumbnail=sub.group('imgurl'),
                path=plugin.url_for('dbsubject', subject=sub.group('id')),
            )

            if len(context_menu_items) > 0 and listitem != None:
                listitem.add_context_menu_items(context_menu_items)
                menus.append(listitem)

        m = re.search("\x22count\x22.*?(?P<count>[0-9]+)", rsp, re.DOTALL)
        if m:
            count = int(m.group('count'))
            totalpage = int((count - 1) / 30)
            if int(page) < totalpage:
                menus.append({
                    'label':
                    '下一页',
                    'thumbnail':
                    xbmc.translatePath(
                        os.path.join(IMAGES_PATH, 'nextpage.png')),
                    'path':
                    plugin.url_for('dbactor',
                                   sstr=six.ensure_binary(sstr),
                                   sort=sort,
                                   page=int(page) + 1)
                })
        #plugin.set_content('images')
        comm.setthumbnail = True
        return menus
        return menus

    except Exception as e:
        notify(str(e))
        xbmc.log(msg=format_exc(), level=xbmc.LOGERROR)
        return
Esempio n. 9
0
def dbsearch(sstr, page=0):
    if not sstr or sstr == '0':
        sstr = keyboard()
        if not sstr or sstr == '0':
            return
    try:
        sstr = re.sub(r'\s+', '', sstr)
        url = 'https://www.douban.com/j/search?' + parse.urlencode(
            encode_obj({
                'q': sstr,
                'start': int(page) * 20,
                'cat': 1002
            }))
        rsp = _http(url)
        minfo = json.loads(rsp[rsp.index('{'):])
        menus = []
        if 'items' in minfo:
            for item in minfo['items']:
                rtxt = r'subject%2F(.*?)%2F.*?<img\s+src="(.*?)">.*?}\s*\x29\s*"\s*>(.*?)\s*</a>.*?rating-info">(.*?)</div>'
                patt = re.compile(rtxt, re.S)
                m = patt.search(item)
                if m:
                    rat = '-'
                    ratm = re.search(r'rating_nums">(.*?)</span>', m.group(4),
                                     re.DOTALL | re.IGNORECASE)
                    if ratm:
                        rat = ratm.group(1)
                    searchtitle = m.group(3).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({
                        'label':
                        '%s[[COLOR FFFF3333]%s[/COLOR]]' % (m.group(3), rat),
                        'path':
                        plugin.url_for('dbsubject', subject=m.group(1)),
                        'thumbnail':
                        m.group(2),
                        'context_menu': [(
                            '搜索' + colorize_label(searchtitle, color='00FF00'),
                            'Container.update(' +
                            plugin.url_for('searchinit',
                                           stypes='pan,bt',
                                           sstr=six.ensure_binary(m.group(2)),
                                           modify='1',
                                           otherargs='{}') + ')',
                        )],
                    })
                else:
                    plugin.log.error(item)
    except:
        xbmc.log(msg=format_exc(), level=xbmc.LOGERROR)
        return
    #try:
    if 'more' in minfo:
        if minfo['more']:
            menus.append({
                'label':
                '下一页',
                'path':
                plugin.url_for('dbsearch',
                               sstr=six.ensure_binary(sstr),
                               page=str(int(page) + 1)),
                'thumbnail':
                xbmc.translatePath(os.path.join(IMAGES_PATH, 'nextpage.png')),
            })
    #except: pass
    comm.setthumbnail = True
    return menus
Esempio n. 10
0
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
Esempio n. 11
0
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
Esempio n. 12
0
def javlist(qbbb='qb', filtertype='0', filterkey='0', page=1):
    if not 'base' in javbusurl.raw_dict():
        getjavbusurl()
    if not 'existmag' in javbusurl.raw_dict():
        javbusurl['existmag'] = 'all'
    filterkey = filterkey.replace(' ', '')
    filterkey = parse.quote(filterkey)
    filter = ''
    if filtertype != '0':
        if filterkey != '0':
            filter = '/%s/%s' % (filtertype, filterkey)

        else:
            if filtertype == 'search':
                if not filterkey or filterkey == '0':
                    filterkey = keyboard()
                    if not filterkey or filterkey == '0':
                        return
                filter = '/%s/%s' % (filtertype, filterkey.replace(' ', ''))
            else:
                filter = '/' + filtertype
    pagestr = ''
    if int(page) > 1:
        if filter:
            pagestr = '/' + str(page)
        else:
            pagestr = '/page/' + str(page)
    url = '%s%s%s' % (javbusurl[qbbb], filter, pagestr)
    if filtertype == 'search':
        url = url + '&type=1'
    #xbmc.log(url)
    try:
        menus = []
        if javbusurl['existmag'] == 'all':
            menus.append({
                'label':
                '已显示所有片片',
                'path':
                plugin.url_for('chg_existmag',
                               qbbb=qbbb,
                               filtertype=filtertype,
                               filterkey=filterkey),
                'thumbnail':
                xbmc.translatePath(os.path.join(IMAGES_PATH, 'movies.png'))
            })
        else:
            menus.append({
                'label':
                '已显示有磁片片',
                'path':
                plugin.url_for('chg_existmag',
                               qbbb=qbbb,
                               filtertype=filtertype,
                               filterkey=filterkey),
                'thumbnail':
                xbmc.translatePath(os.path.join(IMAGES_PATH, 'magnet.png'))
            })
        rsp = _http(url, cookie='existmag=' + javbusurl['existmag'])

        releech = 'movie-box.*?href="(?P<detailurl>.*?)".*?src="(?P<imageurl>.*?)".*?title="(?P<title>.*?)".*?<date>(?P<id>.*?)</date>.*?<date>(?P<date>.*?)</date>'
        # if qbbb=='om':
        # releech='"item pull-left".*?href="(?P<detailurl>.*?)".*?src="(?P<imageurl>.*?)".*?"_blank">(?P<title>.*?)</a><br>.*?"item-title">(?P<id>.*?)</span>.*?"item-title">(?P<date>.*?)</span>'
        leech = re.compile(releech, re.S)
        for match in leech.finditer(rsp):
            detailurl = match.group('detailurl')
            movieno = detailurl[detailurl.rfind('/') + 1:]
            context_menu_items = []
            context_menu_items.append((
                '搜索' + colorize_label(match.group('id'), color='00FF00'),
                'Container.update(' + plugin.url_for('searchinit',
                                                     stypes='pan,bt',
                                                     sstr=match.group('id'),
                                                     modify='1',
                                                     otherargs='{}') + ')',
            ))
            coverimg = match.group('imageurl').replace('thumb',
                                                       'cover').replace(
                                                           '.jpg', '_b.jpg')
            listitem = ListItem(
                label='[[COLOR FFFFFF00]%s[/COLOR]]%s(%s)' %
                (match.group('id'), match.group('title'), match.group('date')),
                thumbnail=match.group('imageurl'),
                path=plugin.url_for('javdetail',
                                    qbbb=qbbb,
                                    movieno=movieno,
                                    id=match.group('id'),
                                    title=six.ensure_binary(
                                        match.group('title'))),
            )
            listitem.set_property("Fanart_Image", coverimg)
            #listitem.set_property("Landscape_Image", match.group('imageurl'))
            #listitem.set_property("Poster_Image", match.group('imageurl'))
            #listitem.set_property("Banner_Image", match.group('imageurl'))
            # menus.append({'label':'[[COLOR FFFFFF00]%s[/COLOR]]%s(%s)'%(match.group('id'), match.group('title'), match.group('date')),
            # 'path': plugin.url_for('javdetail',qbbb=qbbb, movieno=movieno,id=match.group('id'),title=match.group('title')),
            # 'thumbnail':match.group('imageurl'),})
            if len(context_menu_items) > 0 and listitem != None:
                listitem.add_context_menu_items(context_menu_items)
                menus.append(listitem)
        strnextpage = str(int(page) + 1)
        strnextpage = '/' + strnextpage + '">' + strnextpage + '</a>'
        if rsp.find(strnextpage) >= 0:
            menus.append({
                'label':
                '下一页',
                'path':
                plugin.url_for('javlist',
                               qbbb=qbbb,
                               filtertype=filtertype,
                               filterkey=filterkey,
                               page=int(page) + 1),
                'thumbnail':
                xbmc.translatePath(os.path.join(IMAGES_PATH, 'nextpage.png'))
            })
        comm.setthumbnail = True
        plugin.set_content('movies')
        return menus
    except Exception as ex:
        notify('片片列表获取失败' + str(ex))
        xbmc.log(msg=format_exc(), level=xbmc.LOGERROR)
        return
Esempio n. 13
0
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