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


Python Decoder.getCastcampLink方法代码示例

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


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

示例1: getChannels

# 需要导入模块: from core.decoder import Decoder [as 别名]
# 或者: from core.decoder.Decoder import getCastcampLink [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


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