Exemple #1
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
Exemple #2
0
def javgernefilter(qbbb='qb'):
    url = javbusurl[qbbb] + '/genre'

    try:
        rsp = _http(url)
        menus = []

        #if qbbb!='om':
        releech = '<h4>(?P<genregroup>.*?)</h4>.*?"row genre-box">(?P<genres>.*?)</div>'
        leech = re.compile(releech, re.S)

        genrelist = {}
        genregrouplist = []
        for match in leech.finditer(rsp):
            genrelist[match.group('genregroup')] = match.group('genres')
            genregrouplist.append(match.group('genregroup'))

        dialog = xbmcgui.Dialog()

        sel = dialog.select('类别模式', genregrouplist)
        if sel == -1: return
        genres = genrelist[genregrouplist[sel]]
        #else:
        #	genres=rsp
        releech = 'href="%s/genre/(?P<genreid>.+?)">(?P<genrename>.+?)</a>' % (
            javbusurl[qbbb])
        leech = re.compile(releech, re.S)
        for match in leech.finditer(genres):
            menus.append({
                'label':
                match.group('genrename'),
                'path':
                plugin.url_for('javlist',
                               qbbb=qbbb,
                               filtertype='genre',
                               filterkey=match.group('genreid'),
                               page=1),
            })
        return menus
    except:
        notify('类型列表获取失败')
        xbmc.log(msg=format_exc(), level=xbmc.LOGERROR)
        return
Exemple #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
Exemple #4
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
Exemple #5
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
Exemple #6
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
Exemple #7
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
Exemple #8
0
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
Exemple #9
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
Exemple #10
0
def getjavbusurl():
    javbusurl['existmag'] = 'all'

    urls = []
    oldurls = plugin.get_setting('javbusfb').lower().split(';')

    for url in oldurls:
        if url_is_alive(url):
            urls.append(url.strip().rstrip('/'))

    if len(urls) <= 0:
        rsp = comm.jubt()
        match = re.search(
            r"window\x2Eopen\x28[\x22\x27](?P<url>(?:http|https)\x3A[\w\x2E\x2F]*?)[\x22\x27](?:(?!window).)*?strong\x3EJavBus\s*\x7C.*?\x3C\x2Fdiv\x3E",
            rsp, re.IGNORECASE | re.DOTALL)
        if match:
            urls = [match.group('url').strip().rstrip('/')]
    if len(urls) > 0:
        #notify(urls[0])
        rsp = _http(urls[0])
        for match in re.finditer(
                r"[\x22\x27]nofollow[\x22\x27]\x3E(?P<url>(?:http|https)\x3A[\w\x2E\x2F]*?)\x3C\x2Fa\x3E",
                rsp, re.IGNORECASE | re.DOTALL):
            urls.append(match.group('url'))
        match = re.search(
            r"href\x3D[\x22\x27](?P<url>(?:http|https)\x3A[\w\x2E\x2F]*?)[\x22\x27]\x3E歐美",
            rsp, re.IGNORECASE | re.DOTALL)
        if match:
            plugin.set_setting('javbusom',
                               match.group('url').strip().rstrip('/'))
    if len(urls) <= 0:
        notify('JAVBUS网址更新失败!')
    else:
        javbusfb = ''
        urls = list(set(urls))
        for url in urls:
            javbusfb += url + ';'
        plugin.set_setting('javbusfb', javbusfb)
    urls = []
    for url in plugin.get_setting('javbusfb').lower().split(';'):
        urls.append(url.strip())
    try:
        dialog = xbmcgui.Dialog()
        sel = dialog.select('网址选择', urls)
        if sel == -1: return

        javbusurl['base'] = urls[sel]
        javbusurl['qb'] = urls[sel]
        javbusurl['bb'] = urls[sel] + '/uncensored'
        javbusurl['om'] = plugin.get_setting('javbusom').lower()
        '''
        rspbase=_http(javbusurl['base']+'/')
        match = re.search(r'visible-sm-block.*?href="([0-9a-zA-Z\x2E\x2F\x3A]*?)/">歐美', rspbase, re.DOTALL | re.MULTILINE)
        if match:
            javbusurl['om'] = match.group(1)
            notify('JAVBUS网址更新成功!')
        '''
    except:
        xbmc.log(msg=format_exc(), level=xbmc.LOGERROR)
        notify('JAVBUS网址更新失败')
        javbusurl['om'] = plugin.get_setting('javbusom').lower()