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


Python Decoder.decode247bay方法代码示例

本文整理汇总了Python中core.decoder.Decoder.decode247bay方法的典型用法代码示例。如果您正苦于以下问题:Python Decoder.decode247bay方法的具体用法?Python Decoder.decode247bay怎么用?Python Decoder.decode247bay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在core.decoder.Decoder的用法示例。


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

示例1: getChannels

# 需要导入模块: from core.decoder import Decoder [as 别名]
# 或者: from core.decoder.Decoder import decode247bay [as 别名]
 def getChannels(page):
     x = []
     logger.debug("page is: "+page)
     if str(page) == '0':
         page=Zonasportsme.MAIN_URL
     else:
         logger.debug("decoding page: "+page)
         page = base64.b64decode(page)
         logger.debug("decoded page: "+page)
     logger.debug("launching web petition to page: "+page)
     html = Zonasportsme.getContentFromUrl(page,"",Zonasportsme.cookie,Zonasportsme.MAIN_URL)
     if page==Zonasportsme.MAIN_URL:
         logger.debug("browsing main menu...")
         menu = Decoder.extract('<ul class="nav" id="main-menu">',"</li></ul></li></ul>",html)
         x = Zonasportsme.extractElements(menu)
     else:
         url = ""
         #decoder part
         if 'http://www.ustream.tv/' in html:
             uStreamUrl = Decoder.extractWithRegex('http://www.ustream.','"',html)
             url = Decoder.getUstreamLink(uStreamUrl,page)
         elif 'castamp.com/embed.js' in html:
             channel = Decoder.extract('channel="','"',html)
             url = Decoder.getCastcampLink(channel,page)
         elif 'adca.st/broadcast/player.js' in html:
             if "<script type='text/javascript'>id='" in html:
                 id2 = Decoder.extract("<script type='text/javascript'>id='", "';", html)
             logger.debug("using id = " + id2)
             url4 = "http://bro.adca.st/stream.php?id=" + id2 + "&width=700&height=450&stretching=uniform"
             html4 = Zonasportsme.getContentFromUrl(url4, "", Zonasportsme.cookie, page)
             logger.debug("html4: " + html4)
             curl = Decoder.rExtract('= "', '=";', html4)+'='
             fn = Decoder.rExtract('"','.php";',html4)
             token = Zonasportsme.getContentFromUrl('http://bro.adca.st/'+fn+'.php', "",Zonasportsme.cookie, url4, True)
             logger.debug("token: " + token)
             token = Decoder.extract('":"', '"', token)
             file = base64.decodestring(curl) + token + "|" + Downloader.getHeaders('http://cdn.allofme.site/jw/jwplayer.flash.swf')
             logger.debug("final url is: " + file)
             url = file
         elif 'zony.tv/static/scripts/zony.js' in html:
             channel = Decoder.extract("channel='","'",html)
             url = 'http://www.zony.tv/embedplayer/'+channel+'/1/700/400/'
             html2 = Zonasportsme.getContentFromUrl(url=url,referer=page)
             logger.debug("html2 is: "+html2)
             #newParam = Decoder.extract("so.addParam('FlashVars', '", "'", html2)  # brute params, needs a sort
             newParam = Decoder.extractParams(html2)
             rtmp = "rtmp://146.185.16.62/stream playPath="+newParam+" swfVfy=1 timeout=10 conn=S:OK live=true swfUrl=http://www.zony.tv/static/scripts/fplayer.swf flashver=WIN/2019,0,0,226 pageUrl="+page
             url = rtmp
         elif 'http://www.embeducaster.com/static/' in html:
             channel = Decoder.extract("channel='", "'", html)
             url = 'http://www.embeducaster.com/embedplayer/' + channel + '/1/700/400/'
             html2 = Zonasportsme.getContentFromUrl(url=url, referer=page)
             logger.debug("html2 is: " + html2)
             url = Decoder.decodeUcaster(html2,url)
         elif '247bay.tv/static/' in html:
             channel = Decoder.extract("channel='", "'", html)
             url = 'http://www.247bay.tv/embedplayer/'+channel+'/2/750/420'
             url = Decoder.decode247bay(url,page)
         element = {}
         element["title"] = "Stream"
         element["link"] = url
         element["permaLink"] = True
         x.append(element)
     return x
开发者ID:harddevelop,项目名称:tvbox,代码行数:66,代码来源:zonasportsme.py

示例2: getChannels

# 需要导入模块: from core.decoder import Decoder [as 别名]
# 或者: from core.decoder.Decoder import decode247bay [as 别名]
    def getChannels(page):
        x = []
        element = {}
        if str(page) == '0':
            page=Vipracinginfo.MAIN_URL3
            html = Vipracinginfo.getContentFromUrl(page,"",Vipracinginfo.cookie,"")
            #print html
            if html.find("var channels = JSON.parse('")>-1: #it's a list, needs decode
                table = Decoder.extract("var channels = JSON.parse('","'),",html)
                table = table.replace('\u00f3','ó').replace('\u00f1','ñ').replace('\/',"-")#.replace('"',"'")
                x = Vipracinginfo.extractElements(table,Vipracinginfo.MAIN_URL3)
                logger.debug("Vipracing channels logic done!")
            else:
                #change domain to alternative and repeat the same logic
                html = Vipracinginfo.getContentFromUrl(Vipracinginfo.MAIN_URL3,"",Vipracinginfo.cookie,"")
                #print html
                if html.find("var channels = JSON.parse('")>-1: #it's a list, needs decode
                    table = Decoder.extract("var channels = JSON.parse('","'),",html)
                    table = table.replace('\u00f3','ó').replace('\u00f1','ñ').replace('\/',"-")#.replace('"',"'")
                    x = Vipracinginfo.extractElements(table,Vipracinginfo.MAIN_URL3)
                    logger.debug("done with the second loop, detected channels: "+str(len(x)))
        else:
            html = Vipracinginfo.getContentFromUrl(url=page)
            logger.debug("html: " + html)
            logger.debug("launching Vipracing else logic")
            if html.find('http://www.streamlive.to/embed/')>-1:
                link = Decoder.decodeStreamliveto(html,page)
                element["link"] = link
                element["title"] = Decoder.extract("<title>","</title>",html)
                element["permalink"] = True
                x.append(element)
            elif html.find("http://www.janjua.tv")!=-1:
                channel = Decoder.extract(" width=653, height=410, channel='","'",html)
                url2 = "http://www.janjuaplayer.com/embedplayer/"+channel+"/1/653/410"
                html2 = Vipracinginfo.getContentFromUrl(url2,"",Vipracinginfo.cookie,page)
                bruteContent = Decoder.extract("so.addParam('FlashVars', '","');",html2)
                #extract id and pk
                id = bruteContent[0:bruteContent.find("&")]
                pk = bruteContent[bruteContent.find('pk='):]
                # loadbalancer is http://www.janjuapublisher.com:1935/loadbalancer?53346
                ip = Vipracinginfo.getContentFromUrl("http://www.janjuapublisher.com:1935/loadbalancer?"+(id[id.find("=")+1:]),"","","http://www.janjuaplayer.com/resources/scripts/eplayer.swf").replace('redirect=','')
                link = "rtmp://"+ip+"/live"+" swfUrl=http://www.janjuaplayer.com/resources/scripts/eplayer.swf pageUrl="+url2+" flashver=WIN/2019,0,0,226 live=true timeout=11 playpath="+channel+"?"+id+"&"+pk
                link = "rtmp://"+ip+"/live"+channel+"?"+id+"&"+pk+" app=live pageUrl="+url2+" swfUrl=http://www.janjuaplayer.com/resources/scripts/eplayer.swf tcUrl=rtmp://"+ip+"/live playPath="+channel+"?"+id+"&"+pk+" conn=S:OK live=1 flashver=WIN/2019,0,0,226"
                element["link"] = link
                element["title"] = channel
                element["permalink"] = True
                x.append(element)
            else:
                logger.debug("launching Vipracing else ELSE logic (other provider embed - max-deportv)")
                html2 = ""
                if ' SRC="' in html:
                    iframeUrl = Decoder.extract(' SRC="','"',html)
                    html2 = Vipracinginfo.getContentFromUrl(iframeUrl, "", Vipracinginfo.cookie, page)
                elif '<iframe name="vipracing" src="' in html:
                    iframeUrl = Decoder.extract('<iframe name="vipracing" src="','"',html)
                    html2 = Vipracinginfo.getContentFromUrl(iframeUrl)
                logger.debug("html2 is: "+html2)
                if 'http://max-deportv' in html2:
                    logger.debug("using max-deportv way")
                    iframeUrl2 = Decoder.extractWithRegex("http://max-deportv",'"',html2)
                    iframeUrl2 = iframeUrl2[0:len(iframeUrl2)-1]
                    logger.debug("using iframeUrl: "+iframeUrl2)
                    html3 = Vipracinginfo.getContentFromUrl(iframeUrl2,"",Vipracinginfo.cookie,iframeUrl)
                    iframeUrl3 = Decoder.extractWithRegex('http://www.iguide.to/embed/','">',html3)
                    iframeUrl3 = iframeUrl3[:len(iframeUrl3)-1]
                    #extract channelId
                    channelId = Decoder.extract('embed/','&',iframeUrl3)
                    iframeUrl3 = "http://www.iguide.to/embedplayer_new.php?width=650&height=400&channel="+channelId+"&autoplay=true"
                    link = Decoder.decodeIguide(iframeUrl3,iframeUrl2)
                elif 'http://www.streamlive.to' in html2:
                    streamLiveScript = Decoder.extractWithRegex('http://www.streamlive.to','"',html2).replace('"','')
                    link = Decoder.decodeStreamliveto(streamLiveScript, iframeUrl)
                    logger.debug("using streamlive way...")
                elif '<iframe name="vipracing" src="http://vipracing.' in html:
                    logger.debug("detected vipracing embed iframe, other loop...")
                    iframeUrlLoop = Decoder.extract('<iframe name="vipracing" src="','"',html)
                    element2 = Vipracinginfo.getChannels(iframeUrlLoop)[0]
                    link = element2["link"]
                    page = element2["title"]
                elif '247bay.tv/static/scripts/247bay.js' in html:
                    channel = Decoder.extract(", channel='","'",html)
                    url2 = 'http://www.247bay.tv/embedplayer/'+channel+'/2/653/410'
                    link = Decoder.decode247bay(url2,page)
                elif 'castalba.tv/js/embed.js' in html:
                    cid = Decoder.extract(' id="','"',html)
                    link = 'http://www.castalba.tv/embed.php?cid='+cid+'&wh=653&ht=410&d=vipracing.info'
                    link = Decoder.decodeCastalbatv(link, page)
                elif 'http://cricfree.sc/update/' in html:
                    frameUrl = Decoder.extractWithRegex('http://cricfree.sc/update','.php',html)
                    link = Cricfreetv.getChannels(frameUrl)[0]["link"]
                elif 'http://crichd.tv/update/' in html:
                    frameUrl = Decoder.extractWithRegex('http://crichd.tv/update/',".php",html)
                    link = Cricfreetv.getChannels(frameUrl)[0]["link"]
                    #html2 = Downloader.getContentFromUrl(url=frameUrl)
                    #if 'cast4u' in html2:
                    #    url2 = "http://www.cast4u.tv/embedcr.php?v="+Decoder.extract('fid=\'','\'',html2)+"&vw=620&vh=490"
                    #    link = Cricfreetv.extractIframe(url2,frameUrl)[0]["link"]

                else:
                    logger.debug("Nothing done: "+html+", \nhtml2: "+html2)
#.........这里部分代码省略.........
开发者ID:harddevelop,项目名称:tvbox,代码行数:103,代码来源:vipracinginfo.py


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