当前位置: 首页>>代码示例>>Python>>正文


Python utils.getHtml函数代码示例

本文整理汇总了Python中resources.lib.utils.getHtml函数的典型用法代码示例。如果您正苦于以下问题:Python getHtml函数的具体用法?Python getHtml怎么用?Python getHtml使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getHtml函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getNowVideo

def getNowVideo(url):
    progress.update(50, "", "Opening NowVideo page", "")
    videopage = utils.getHtml(url, "")
    if not "flashvars.file" in videopage:
        videoid = re.compile('/video/([^"]+)').findall(videopage)[0]
        url = "http://embed.nowvideo.sx/embed/?v=" + videoid
        videopage = utils.getHtml(url, "")
    fileid = re.compile('flashvars.file="(.+?)";').findall(videopage)[0]
    codeid = re.compile('flashvars.cid="(.+?)";').findall(videopage)
    if len(codeid) > 0:
        codeid = codeid[0]
    else:
        codeid = ""
    keycode = re.compile("flashvars.filekey=(.+?);").findall(videopage)[0]
    keycode = re.compile("var\s*" + keycode + '="(.+?)";').findall(videopage)[0]
    videolink = (
        "http://www.nowvideo.sx/api/player.api.php?codes="
        + urllib.quote_plus(codeid)
        + "&key="
        + urllib.quote_plus(keycode)
        + "&file="
        + urllib.quote_plus(fileid)
    )
    progress.update(60, "", "Grabbing video file", "")
    vidcontent = utils.getHtml(videolink, "")
    videourl = re.compile("url=(.+?)\&").findall(vidcontent)[0]
    progress.update(80, "", "Returning video file", "")
    return videourl
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:28,代码来源:pornhive.py

示例2: BGVersion

def BGVersion():
    bgpage = utils.getHtml('https://beeg.com','')
    bgversion = re.compile(r"cpl/(\d+)\.js", re.DOTALL | re.IGNORECASE).findall(bgpage)[0]
    bgsavedversion = addon.getSetting('bgversion')
    if bgversion != bgsavedversion or not addon.getSetting('bgsalt'):
        addon.setSetting('bgversion',bgversion)
        bgjspage = utils.getHtml('https://beeg.com/static/cpl/'+bgversion+'.js','https://beeg.com')
        bgsalt = re.compile('beeg_salt="([^"]+)"', re.DOTALL | re.IGNORECASE).findall(bgjspage)[0]
        addon.setSetting('bgsalt',bgsalt)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:9,代码来源:beeg.py

示例3: get_porn00

def get_porn00(url):
    videopage = utils.getHtml(url)
    try:
        alternatives_div = re.compile('<div id="alternatives">(.*?)</div', re.DOTALL | re.IGNORECASE).search(videopage).group(1)
        alternatives = re.compile('''href=['"]([^'"]+)['"]''', re.DOTALL | re.IGNORECASE).findall(alternatives_div)
        for alternative in alternatives:
            videopage += utils.getHtml(alternative)
    except AttributeError:
        pass
    return '\n'.join(re.compile('<div class="video-box">(.*?)</iframe', re.DOTALL | re.IGNORECASE).findall(videopage))
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:10,代码来源:hdporn.py

示例4: Playvid

def Playvid(url, name, download=None):
    videopage = utils.getHtml(url)
    plurl = re.compile('\?u=([^"]+)"', re.DOTALL | re.IGNORECASE).findall(videopage)[0]
    plurl = "http://sexix.net/qaqqew/playlist.php?u=" + plurl
    plpage = utils.getHtml(plurl, url)
    videourl = re.compile('file="([^"]+)"', re.DOTALL | re.IGNORECASE).findall(plpage)[0]
    if videourl:
        utils.playvid(videourl, name, download)
    else:
        utils.notify("Oh oh", "Couldn't find a video")
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:10,代码来源:sexix.py

示例5: pl_play

def pl_play(url, name, download=None):
    vp = utils.VideoPlayer(name, download=download, regex='''src\s*=\s*["']([^'"]+)''')
    vp.progress.update(5, "", "Loading video page 1", "")
    response = utils.getHtml(url)
    video_players = re.compile('class="embed-sites"(.*?)class="video-detail"', re.DOTALL | re.IGNORECASE).findall(response)[0]
    source_ids = re.compile('changeDefaultSourceID[(](.?)[)]', re.DOTALL | re.IGNORECASE).findall(video_players)
    for idx, source_id in enumerate(source_ids):
        vp.progress.update( 5 + (15 * idx / len(source_ids)), "", "Loading video page {}".format(idx + 2), "" )
        response = utils.getHtml(url, hdr=create_header_for_source(source_id))
        video_players += re.compile('class="embed-sites"(.*?)class="video-detail"', re.DOTALL | re.IGNORECASE).findall(response)[0]
    vp.play_from_html(video_players)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:11,代码来源:pornsland.py

示例6: Playvid

def Playvid(url, name, download=None):
    progress.create('Play video', 'Searching videofile.')
    progress.update( 10, "", "Loading video page", "" )
    html = utils.getHtml(url, '')
    embedLinks = re.compile('<a href="([^"]+)" rel="nofollow" target="_blank">').findall(html)
    url = ''
    for link in embedLinks:
        if 'embedlink' in link:
            try:
                html = utils.getHtml(link, '')
                if 'Base64' in html:
                    base64str = re.compile(r'Base64\.decode\("([^"]+)"').findall(html)
                    url = url + " " + base64.b64decode(base64str[0])
            except: pass
    utils.playvideo(url, name, download, url)
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:15,代码来源:cat3movie.py

示例7: Playvid

def Playvid(url, name, download=None):
    print "mrsexe::Playvid " + url
    html = utils.getHtml(url, '')
    videourl = re.compile(r"src='(/inc/clic\.php\?video=.+?&cat=mrsex.+?)'").findall(html)
    html = utils.getHtml('http://www.mrsexe.com/' + videourl[0], '')
    videourls = re.compile(r"'file': \"(.+?)\",.+?'label': '(.+?)'", re.DOTALL).findall(html)
    videourls = sorted(videourls, key=lambda tup: tup[1], reverse=True)
    videourl = videourls[0][0]
    if download == 1:
        utils.downloadVideo(videourl, name)
    else:    
        iconimage = xbmc.getInfoImage("ListItem.Thumb")
        listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
        listitem.setInfo('video', {'Title': name, 'Genre': 'Porn'})
        xbmc.Player().play(videourl, listitem)
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:15,代码来源:mrsexe.py

示例8: Categories

def Categories(url):
    cathtml = utils.getHtml(url, '')
    match = re.compile('/tag/([^/]+)/" cla[^>]+>([^<]+)<', re.DOTALL | re.IGNORECASE).findall(cathtml)
    for catpage, name in match:
        catpage = "http://hentaihaven.org/ajax.php?action=pukka_infinite_scroll&page_no=1&grid_params=infinite_scroll=on&infinite_page=2&infinite_more=true&current_page=taxonomy&front_page_cats=&inner_grid%5Buse_inner_grid%5D=on&inner_grid%5Btax%5D=post_tag&inner_grid%5Bterm_id%5D=53&inner_grid%5Bdate%5D=&search_query=&tdo_tag=" + catpage + "&sort=date" 
        utils.addDir(name, catpage, 461, '')    
    xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:7,代码来源:hentaihaven.py

示例9: getFly

def getFly(url):
    videopage = utils.getHtml(url, '')
    videos = re.compile('fileUrl="([^"]+)"', re.DOTALL | re.IGNORECASE).findall(videopage)
    videourl = videos[-1]
    if videourl.startswith('//'):
        videourl = 'https:' + videourl
    return videourl
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:7,代码来源:hqporner.py

示例10: listColeccions

def listColeccions():
    xbmc.log("--------------listColeccions----------")
    
    link = getHtml(url_coleccions)
    
    if link:
    
        soup = BeautifulSoup(link)
        
        try: 
            
            colecc = soup.findAll("a", {"class" : "media-object"})
            xbmc.log("Col·leccions - elements trobats: " + str(len(colecc)))
            
            for a in colecc:
               
                url = a["href"]
                url = url_base + url
                t = a["title"]
                titol = t.encode("utf-8")
                xbmc.log("Col·leccions -t: " + titol)
                img = a.img["src"]
              
                addDir(titol ,url,'listvideos', img)
                
        except AttributeError as e:
            xbmc.log("Exception AtributeError listColeccions: " + str(e))
        except KeyError as e:
            xbmc.log("Exception KeyError listColeccions: " + str(e))
        except Exception as e:
            xbmc.log("Exception listColeccions: " + str(e))
        
            
        xbmcplugin.endOfDirectory(addon_handle) 
开发者ID:jqandreu,项目名称:plugin.video.tv3.cat,代码行数:34,代码来源:default.py

示例11: Playvid

def Playvid(url, name, download=None):
    videopage = utils.getHtml(url)
    videourl = re.compile('class="btn btn-1 btn-1e" href="([^"]+)" target="_blank"', re.DOTALL | re.IGNORECASE).findall(videopage)[0]
    if videourl:
        utils.playvid(videourl, name, download)
    else:
        utils.notify('Oh oh','Couldn\'t find a video')
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:7,代码来源:hentaihaven.py

示例12: Cat

def Cat(url):
    cathtml = utils.getHtml(url, '')
    match = re.compile('0" value="([^"]+)">([^<]+)<', re.DOTALL | re.IGNORECASE).findall(cathtml)
    for catpage, name in match:
        catpage = 'http://k18.co/?cat=' + catpage
        utils.addDir(name, catpage, 231, '')
    xbmcplugin.endOfDirectory(utils.addon_handle)   
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:7,代码来源:k18.py

示例13: datoporn_cat

def datoporn_cat(url):
    listhtml = utils.getHtml(url)
    match = re.compile('''class="vid_block".*?href="([^"]+)".*?url[(]([^)]+)[)].*?<span>([^<]+)</span>.*?<b>([^<]+)</b''', re.DOTALL | re.IGNORECASE).findall(listhtml)
    for catpage, img, count, name in sorted(match, key=lambda x: x[3].strip().lower()):
        name = utils.cleantext(name.strip()) + " [COLOR deeppink]" + count.strip() + "[/COLOR]"
        utils.addDir(name, catpage, 671, img, 1)
    xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:7,代码来源:datoporn.py

示例14: Categories

def Categories():
    cathtml = utils.getHtml('https://www.vporn.com/', '')
    match = re.compile('<li><a href="/cat/(.+?)"><img .*>(.+?)</a></li>').findall(cathtml)
    for catid, name in match[1:]:
        catpage = "https://www.vporn.com/cat/"+ catid
        utils.addDir(name, catpage, 501, '')
    xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:7,代码来源:vporn.py

示例15: List

def List(url):
    try:
        listhtml = utils.getHtml(url, '')
    except:
        
        return None
    match = re.compile('thumb-main-titre"><a href="..([^"]+)".*?title="([^"]+)".*?src="([^"]+)".*?<div class="thumb-info">(.*?)time">([^<]+)<', re.DOTALL | re.IGNORECASE).findall(listhtml)
    for videourl, name, img, hd, duration in match:
        name = utils.cleantext(name)
        if hd.find('hd') > 0:
            if hd.find('full') > 0:
                hd = " [COLOR yellow]FULLHD[/COLOR] "
            else:
                hd = " [COLOR orange]HD[/COLOR] "
        else:
            hd = " "
        videopage = "http://www.absoluporn.com" + videourl
        videopage = videopage.replace(" ","%20")
        name = name + hd + "[COLOR deeppink]" + duration + "[/COLOR]"
        utils.addDownLink(name, videopage, 302, img, '')
    try:
        nextp=re.compile(r'<span class="text16">\d+</span> <a href="..([^"]+)"').findall(listhtml)[0]
        nextp = nextp.replace(" ","%20")
        utils.addDir('Next Page', 'http://www.absoluporn.com' + nextp, 301,'')
    except: pass    
    xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:26,代码来源:absoluporn.py


注:本文中的resources.lib.utils.getHtml函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。