當前位置: 首頁>>代碼示例>>Python>>正文


Python Decoder.decodeAdfly方法代碼示例

本文整理匯總了Python中core.decoder.Decoder.decodeAdfly方法的典型用法代碼示例。如果您正苦於以下問題:Python Decoder.decodeAdfly方法的具體用法?Python Decoder.decodeAdfly怎麽用?Python Decoder.decodeAdfly使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在core.decoder.Decoder的用法示例。


在下文中一共展示了Decoder.decodeAdfly方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: getChannels

# 需要導入模塊: from core.decoder import Decoder [as 別名]
# 或者: from core.decoder.Decoder import decodeAdfly [as 別名]
 def getChannels(page):
     x = []
     if page == '0':
         page = RedeneobuxCom.LIST_PAGE
         results = RedeneobuxCom.getContentFromUrl(page)
         i=0
         for result in results.split('<div class="media">'):
             if i>0:
                 element = {}
                 img = Decoder.extract('<img src=\'',"'",result)
                 link = Decoder.extract('location.href=\'', "'", result)
                 title = Decoder.extract('\' alt=\'', "'", result)
                 if "http" in link:
                     logger.debug("appending result: "+title+", url: "+link)
                     element["title"] = title
                     element["link"] = link
                     element["thumbnail"] = img
                     x.append(element)
             i+=1
     else:
         content = RedeneobuxCom.getContentFromUrl(url=page,referer=RedeneobuxCom.LIST_PAGE)
         logger.debug("list content is: " + content)
         url = Decoder.extractWithRegex('http'," ",content).replace(" ","")
         logger.debug("url is: " + url)
         if 'adf' in url:
             listUrl = Decoder.decodeAdfly(url)
             logger.debug("list obtained is: "+listUrl)
             m3uContent = Downloader.getSimpleDownload(listUrl) #simple urllib2 download
             logger.debug("content: "+m3uContent)
             i=0
             for lineContent in m3uContent.split('#EXTINF:'):
                 if i>0:
                     title = Decoder.extract(',','\n',lineContent)
                     lineContent = lineContent[lineContent.find("\n"):]
                     urlContent = Decoder.extractWithRegex('http://',"\n",lineContent).replace('\n','')
                     element = {}
                     element["title"] = title
                     element["link"] = urlContent#+"|"+Downloader.getHeaders(listUrl)
                     element["thumbnail"] = ''
                     element["finalLink"] = True
                     if "://" in urlContent:
                         logger.debug("added: " + title + ", content: " + urlContent)
                         x.append(element)
                 i+=1
     return x
開發者ID:harddevelop,項目名稱:tvbox,代碼行數:47,代碼來源:redeneobuxcom.py


注:本文中的core.decoder.Decoder.decodeAdfly方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。