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


Python CParsingHelper.getDataBeetwenMarkers方法代码示例

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


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

示例1: getWebCamera

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper import getDataBeetwenMarkers [as 别名]
 def getWebCamera(self, cItem):
     printDBG("getWebCamera start")
     sts, data = self.cm.getPage(cItem['url'])
     if sts:
         if cItem['title'] == 'WebCamera PL':
             params = dict(cItem)
             params.update({'title':'Polecane kamery'})
             self.addDir(params)
             data = CParsingHelper.getDataBeetwenMarkers(data, '<h4>Kamery wg kategorii</h4>', '</div>', False)[1]
             data = data.split('</a>')
             del data[-1]
             for item in data:
                 url = self.cm.ph.getSearchGroups(item, """href=['"](http[^'^"]+?)['"]""")[0]
                 if '' != url:
                     params = dict(cItem)
                     params.update({'title':self._cleanHtmlStr(item), 'url':url})
                     self.addDir(params)
         else:
             data = CParsingHelper.getDataBeetwenMarkers(data, '<div class="inlinecam', '<div id="footerbar">', False)[1]
             data = data.split('<div class="inlinecam')
             for item in data:
                 item = CParsingHelper.getDataBeetwenMarkers(item, '<a', '</div>', True)[1]
                 url = self.cm.ph.getSearchGroups(item, """href=['"](http[^'^"]+?)['"]""")[0]
                 if '' != url:
                     title = self._cleanHtmlStr(CParsingHelper.getDataBeetwenMarkers(item, '<div class="bar">', '</div>', False)[1])
                     icon  = self.cm.ph.getSearchGroups(item, """data-src=['"](http[^'^"]+?)['"]""")[0]
                     params = dict(cItem)
                     params.update({'title':title, 'url':url, 'icon':icon})
                     self.playVideo(params)
开发者ID:samsamsam-iptvplayer,项目名称:iptvplayer-for-e2,代码行数:31,代码来源:hostwebstream.py

示例2: getTeamCastList

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper import getDataBeetwenMarkers [as 别名]
 def getTeamCastList(self, cItem):
     printDBG('getTeamCastList start')
     #http://team-cast.pl.cp-21.webhostbox.net/kanalyFlash/
     #http://team-cast.pl.cp-21.webhostbox.net/
     #src="http://team-cast.pl.cp-21.webhostbox.net/kanalyFlash/film/hbo.html"
     url = cItem['url']
     # list categories
     if '' == url :
         self.teamCastTab = {}
         url = 'http://team-cast.pl.cp-21.webhostbox.net/'
         sts, data = self.cm.getPage(url)
         if not sts: return
         data = CParsingHelper.getDataBeetwenMarkers(data, '<div id="stream-frame">', '<div id="now-watching">', False)[1]
         # remove commented channels
         data = re.sub('<!--[^!]+?-->', '', data)
         data = data.split('<li class="menu_right">')
         del data[0]
         for cat in data:
             catName  = CParsingHelper.getDataBeetwenMarkers(cat, '<a href="#" class="drop">', '</a>', False)[1].strip()
             channels = re.findall('<a href="([^"]+?)">([^<]+?)<img src="http://wrzucaj.net/images/2014/09/12/flash-player-icon.png"', cat)
             if len(channels): 
                 self.teamCastTab[catName] = channels
                 newItem = dict(cItem)
                 newItem.update({'url':catName, 'title':catName + ' (%d)' % len(channels)})
                 self.addDir(newItem)
     elif url in self.teamCastTab:
         # List channels
         for item in self.teamCastTab[url]:
             newItem = dict(cItem)
             newItem.update({'url':item[0], 'title':item[1]})
             self.playVideo(newItem)
     else:
         printExc()
开发者ID:samsamsam-iptvplayer,项目名称:iptvplayer-for-e2,代码行数:35,代码来源:hostwebstream.py

示例3: fillFilters

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper import getDataBeetwenMarkers [as 别名]
    def fillFilters(self, refresh=False):
        printDBG('getFilters')
        def SetFilters(raw, tab):
            printDBG("---------------------")
            for it in raw:
                tab.append({'tab': it[1], 'val': it[0]})
                printDBG("filter: %r" % tab[-1])
                
        if self.filtersFilled and not refresh: 
            return False
        
        sts, data = self.cm.getPage(self.MAINURL)
        if False == sts:
            return

        rawSortFilters = CParsingHelper.getDataBeetwenMarkers(data, 'Sortuj:', '</div>', False)[1]
        rawVerFilters  = CParsingHelper.getDataBeetwenMarkers(data, 'Wyświetl:', '</div>', False)[1]
        rawCatFilters  = CParsingHelper.getDataBeetwenMarkers(data, 'Kategorie Filmowe', '<script>', False)[1]
        data = '' # free data ;)
        rawSortFilters = re.compile('href="[^,]+?\,([^,]+?)\,wszystkie,0\.html">([^<]+?)<').findall(rawSortFilters)
        rawVerFilters  = re.compile('href="[^,]+?\,[^,]+?\,([^,]+?),0\.html">([^<]+?)<').findall(rawVerFilters)
        rawCatFilters  = re.compile('href="([^,]+?\,[^.]+?)\.html">([^<]+?)<').findall(rawCatFilters)
        
        if 0 < len(rawSortFilters) and 0 < len(rawVerFilters) and 0 < len(rawCatFilters):
            self.filters['sort'] = []
            self.filters['ver'] = []
            self.filters['cat'] = [{'tab': 'Wszystkie', 'val': 'glowna'}]
            SetFilters(rawSortFilters, self.filters['sort'])
            SetFilters(rawVerFilters, self.filters['ver'])
            SetFilters(rawCatFilters, self.filters['cat'])
            self.filtersFilled = True
开发者ID:samsamsam-iptvplayer,项目名称:iptvplayer-for-e2,代码行数:33,代码来源:hostplaytube.py

示例4: getLinksForVideo

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper import getDataBeetwenMarkers [as 别名]
 def getLinksForVideo(self, cItem):
     printDBG("MoviesHDCO.getLinksForVideo [%s]" % cItem)
     urlTab = []
     
     sts, data = self.getPage(cItem['url'])
     if not sts: return urlTab
     
     #printDBG(data)
     
     data = CParsingHelper.getDataBeetwenMarkers(data, '<div class="video-embed">', '</div>', False)[1]
     oneLink = CParsingHelper.getDataBeetwenMarkers(data, 'data-rocketsrc="', '"', False)[1]
     if oneLink == '': oneLink =  self.cm.ph.getSearchGroups(data, '<iframe[^>]+?src="([^"]+?)"')[0]
     if oneLink == '': oneLink =  self.cm.ph.getSearchGroups(data, '<script[^>]+?src="([^"]+?)"')[0]
     
     if oneLink.startswith('//'):
         oneLink = 'http:' + oneLink
         
     oneLink = self._getFullUrl(oneLink)
     
     if 'videomega.tv/validatehash.php?' in oneLink:
         sts, data = self.cm.getPage(oneLink, {'header':{'Referer':cItem['url'], 'User-Agent':'Mozilla/5.0'}})
         if not sts: return urlTab
         data = self.cm.ph.getSearchGroups(data, 'ref="([^"]+?)"')[0]
         if '' == data: return urlTab
         oneLink = 'http://videomega.tv/view.php?ref={0}&width=700&height=460&val=1'.format(data)
         
     if '' == oneLink: return urlTab
     name = self.up.getHostName(oneLink)
     urlTab.append({'name':name, 'url':oneLink, 'need_resolve':1})
     return urlTab
开发者ID:a4tech,项目名称:iptvplayer-for-e2,代码行数:32,代码来源:hostmovieshdco.py

示例5: getVideosList

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper import getDataBeetwenMarkers [as 别名]
    def getVideosList(self, url):
        printDBG("getVideosList url[%s]" % url)
        sts, data = self.cm.getPage(url)
        if not sts:
            printDBG("getVideosList except")
            return
        
        # get pagination HTML part
        nextPageData = CParsingHelper.getDataBeetwenMarkers(data, 'class="pager"', '</div>', False)[1]
        # get Video HTML part
        data = CParsingHelper.getDataBeetwenMarkers(data, '<!-- ************ end user menu ************ -->', '</ul>', False)[1].split('<li>')
        del data[0]
        
        for videoItemData in data:
            printDBG('                              videoItemData')
            icon     = ''
            duration = ''
            gatunek  = ''
            plot     = ''
            title    = ''
            url      = ''
            
            if 'class="playIcon"' in videoItemData:
                # get icon src
                match = re.search('src="(http://[^"]+?)"', videoItemData)
                if match: icon = match.group(1).replace('&amp;', '&')
                # get duration
                match = re.search('class="duration"[^>]*?>([^<]+?)<', videoItemData)
                if match: duration = match.group(1).replace('&#39;', "'")
                # get gatunek
                match = re.search('"gatunek"[^>]*?>([^<]+?)<', videoItemData)
                if match: gatunek = match.group(1)
                # get plot
                match = re.search('class="text"[^>]*?>([^<]+?)<', videoItemData)
                if match: plot = match.group(1)
                # get title and url
                match = re.search('<a href="([^"]+?)" class="title"[^>]*?>([^<]+?)</a>', videoItemData)
                if match:
                    url   = self.MAIN_URL + match.group(1)
                    title = match.group(2)
                    params = {'type': 'video', 'page': url, 'title': title, 'icon': icon, 'duration': duration, 'gatunek': gatunek, 'plot': plot}
                    self.currList.append( params )

        # check next page
        nextPageUrl = ''
        match = re.search('href="([^"]+?)" class="nextPage"', nextPageData)
        if match: 
            nextPageUrl = match.group(1)
        else:
            match = re.search('href="([^"]+?)" class="lastPage"', nextPageData)
            if match:
                nextPageUrl = match.group(1)

        if '' != nextPageUrl:
            params = {'type': 'category', 'name': 'sub-category', 'page': self.MAIN_URL + nextPageUrl.replace('&amp;', '&'), 'title': 'Następna strona'}
            self.currList.append( params )
开发者ID:a4tech,项目名称:iptvplayer-for-e2,代码行数:58,代码来源:hostninateka.py

示例6: listSerialSeasons

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper import getDataBeetwenMarkers [as 别名]
 def listSerialSeasons(self, category, url, icon):
     printDBG("listSerialSeasons")
     sts, data = self.cm.getPage( url )
     if False == sts: return
     
     plot = CParsingHelper.getDataBeetwenMarkers(data, '<p class="serialDescription">', '</p>', False)[1]
     data = CParsingHelper.getDataBeetwenMarkers(data, '<div class="seasonExpand">', '<script>', False)[1]
     data = re.compile('<a href="[/]?(serial,[^,]+?,sezon,[1-9][0-9]*?.html)">([^<]+?)</a>').findall(data)
     for item in data:
         if not item[0].startswith('http'):
             url =  self.MAINURL + item[0]
         params = {'name': 'category', 'title': item[1], 'category': category, 'url': url, 'icon':icon, 'plot':plot}
         self.addDir(params)
开发者ID:samsamsam-iptvplayer,项目名称:iptvplayer-for-e2,代码行数:15,代码来源:hostplaytube.py

示例7: listSearchResults

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper import getDataBeetwenMarkers [as 别名]
 def listSearchResults(self, pattern, searchType):
     printDBG("listFilms pattern[%s], searchType[%s]" % (pattern, searchType))
     url = self.MAINURL + 'szukaj.html?query=%s&mID=' % pattern
     sts, data = self.cm.getPage( url )
     if False == sts: return
     
     if 'filmy' == searchType:
         sts, data = CParsingHelper.getDataBeetwenMarkers(data, '<h2 id="movies-res">Filmy:', '<a href="#top"', False)
         category = 'video'
     else:
         sts, data = CParsingHelper.getDataBeetwenMarkers(data, '<h2 id="serials-res">Seriale:', '<a href="#top"', False)
         category = 'Serial_seasons_list'
     data = data.split('<li data-url=')
     self.listItems(data, category)  
开发者ID:samsamsam-iptvplayer,项目名称:iptvplayer-for-e2,代码行数:16,代码来源:hostplaytube.py

示例8: getArticleContent

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper import getDataBeetwenMarkers [as 别名]
 def getArticleContent(self, cItem):
     printDBG("Filmy3dEU.getArticleContent [%s]" % cItem)
     retTab = []
     
     if 'url' not in cItem: return retTab
     
     sts, data = self.cm.getPage(cItem['url'])
     if not sts: return retTab
     
     sts, data = CParsingHelper.getDataBeetwenMarkers(data, "<div id='dle-content'>", '<div class="gf-right">', False)
     title = CParsingHelper.getDataBeetwenMarkers(data, '<h1 class="title">', '</h1>', False)[1]
     icon = self.cm.ph.getSearchGroups(data, 'srct="([^"]+?)"')[0]
     desc = self.cleanHtmlStr( self.cm.ph.getDataBeetwenMarkers(data, '<div class="comment-box-block" id="comment1">', '</div>', False)[1] )
     
     return [{'title':title, 'text':desc, 'images':[]}]
开发者ID:a4tech,项目名称:iptvplayer-for-e2,代码行数:17,代码来源:hostfilmy3deu.py

示例9: getArticleContent

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper import getDataBeetwenMarkers [as 别名]
 def getArticleContent(self, cItem):
     printDBG("MoviesHDCO.getArticleContent [%s]" % cItem)
     retTab = []
     
     if 'url' not in cItem: return []
     
     sts, data = self.getPage(cItem['url'])
     if not sts: return retTab
     
     sts, data = CParsingHelper.getDataBeetwenMarkers(data, '<table id="imdbinfo">', '</table>', False)
     if not sts: return retTab
     
     tmp = data.split('</tr>')
     if len(tmp) < 2: return retTab
     
     title = self.cleanHtmlStr(tmp[0])
     if '' == title: icon = self.cm.ph.getSearchGroups(tmp[1], 'alt="([^"]+?)"')[0]
     icon  = self.cm.ph.getSearchGroups(tmp[1], 'src="([^"]+?)"')[0]
     desc  = self.cm.ph.getDataBeetwenMarkers(tmp[1], '<b>Plot:</b>', '</td>', False)[1]
     
     otherInfo = {}
     tmpTab = [{'mark':'<b>Rating:</b>',   'key':'rating'},
               {'mark':'<b>Director:</b>', 'key':'director'},
               {'mark':'<b>Writer:</b>',   'key':'writer'},
               {'mark':'<b>Stars:</b>',    'key':'stars'},
               {'mark':'<b>Runtime:</b>',  'key':'duration'},
               {'mark':'<b>Rated:</b>',    'key':'rated'},
               {'mark':'<b>Genre:</b>',    'key':'genre'},
               {'mark':'<b>Released:</b>', 'key':'released'},
     ]
     for item in tmpTab:
         val = self.cm.ph.getDataBeetwenMarkers(tmp[1], item['mark'], '</td>', False)[1]
         if '' != val: otherInfo[item['key']] =  self.cleanHtmlStr(val)
     
     return [{'title':self.cleanHtmlStr( title ), 'text': self.cleanHtmlStr( desc ), 'images':[{'title':'', 'url':self._getFullUrl(icon)}], 'other_info':otherInfo}]
开发者ID:friman,项目名称:iptvplayer-for-e2,代码行数:37,代码来源:hostmovieshdco.py

示例10: getF4MLinksWithMeta

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper import getDataBeetwenMarkers [as 别名]
def getF4MLinksWithMeta(manifestUrl, checkExt=True):
    if checkExt and not manifestUrl.split("?")[0].endswith(".f4m"):
        return []

    cm = common()
    headerParams, postData = cm.getParamsFromUrlWithMeta(manifestUrl)

    retPlaylists = []
    sts, data = cm.getPage(manifestUrl, headerParams, postData)
    if sts:
        liveStreamDetected = False
        if "live" == CParsingHelper.getDataBeetwenMarkers("<streamType>", "</streamType>", False):
            liveStreamDetected = True
        bitrates = re.compile('bitrate="([0-9]+?)"').findall(data)
        for item in bitrates:
            link = strwithmeta(manifestUrl, {"iptv_proto": "f4m", "iptv_bitrate": item})
            if liveStreamDetected:
                link.meta["iptv_livestream"] = True
            retPlaylists.append({"name": "[f4m/hds] bitrate[%s]" % item, "url": link})

        if 0 == len(retPlaylists):
            link = strwithmeta(manifestUrl, {"iptv_proto": "f4m"})
            if liveStreamDetected:
                link.meta["iptv_livestream"] = True
            retPlaylists.append({"name": "[f4m/hds]", "url": link})
    return retPlaylists
开发者ID:a4tech,项目名称:iptvplayer-for-e2,代码行数:28,代码来源:urlparserhelper.py

示例11: getF4MLinksWithMeta

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper import getDataBeetwenMarkers [as 别名]
def getF4MLinksWithMeta(manifestUrl, checkExt=True):
    if checkExt and not manifestUrl.split('?')[0].endswith('.f4m'):
        return []
        
    cm = common()
    headerParams, postData = cm.getParamsFromUrlWithMeta(manifestUrl)
    
    retPlaylists = []
    sts, data = cm.getPage(manifestUrl, headerParams, postData)
    if sts:
        liveStreamDetected = False
        if 'live' == CParsingHelper.getDataBeetwenMarkers('<streamType>', '</streamType>', False):
            liveStreamDetected = True
        bitrates = re.compile('bitrate="([0-9]+?)"').findall(data)
        for item in bitrates:
            link = strwithmeta(manifestUrl, {'iptv_proto':'f4m', 'iptv_bitrate':item})
            if liveStreamDetected:
                link.meta['iptv_livestream'] = True
            retPlaylists.append({'name':'[f4m/hds] bitrate[%s]' % item, 'url':link})
        
        if 0 == len(retPlaylists):
            link = strwithmeta(manifestUrl, {'iptv_proto':'f4m'})
            if liveStreamDetected:
                link.meta['iptv_livestream'] = True
            retPlaylists.append({'name':'[f4m/hds]', 'url':link})
    return retPlaylists
开发者ID:c0ns0le,项目名称:iptvplayer-for-e2-fork,代码行数:28,代码来源:urlparserhelper.py

示例12: getVideosFromChannelList

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper import getDataBeetwenMarkers [as 别名]
 def getVideosFromChannelList(self, url, category, page, cItem):
     printDBG('YouTubeParser.getVideosFromChannelList page[%s]' % (page) )
     currList = []
     try:
         sts,data =  self.cm.getPage(url, {'host': self.HOST})
         if sts:
             if '1' == page:
                 sts,data = CParsingHelper.getDataBeetwenMarkers(data, 'feed-item-container', 'footer-container', False)
             else:
                 data = unescapeHTML(data.decode('unicode-escape')).encode('utf-8').replace('\/', '/')
                 
             # nextPage
             match = re.search('data-uix-load-more-href="([^"]+?)"', data)
             if not match: nextPage = ""
             else: nextPage = match.group(1).replace('&amp;', '&')
 
             data = data.split('feed-item-container')
             currList = self.parseListBase(data)
             
             if '' != nextPage:
                 item = dict(cItem)
                 item.update({'title': _("Next page"), 'page': str(int(page) + 1), 'url': 'http://www.youtube.com' + nextPage})
                 currList.append(item)
     except:
         printExc()
         return []
     return currList
开发者ID:c0ns0le,项目名称:iptvplayer-for-e2-fork,代码行数:29,代码来源:youtubeparser.py

示例13: getTop100

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper import getDataBeetwenMarkers [as 别名]
 def getTop100(self, baseUrl, mode): 
     printDBG("getTop100 for url[%s]" % baseUrl)
     post_data = { 'kategoria' : mode }
     sts, data = self.cm.getPage( baseUrl, {}, post_data)
     if False == sts:
         printDBG("getTop100 problem")
         return
         
     sts, data = CParsingHelper.getDataBeetwenMarkers(data, '<div class="ew-top-100"', '</section></div>', True)
     if False == sts:
         printDBG("getTop100 problem no data beetween markers")
         return
     data = data.split('<div class="ew-top-100"')
     if len(data) > 1:
         del data[0]
         place = 1
         for item in data:
             # url & title
             match = re.search('<a href="([^"]+?)" class="en">([^<]+?)</a>[^<]*?<a href="[^"]+?" class="pl">([^<]*?)</a>', item)
             if match: 
                 url = self.MAINURL + match.group(1)
                 title = str(place) + '. ' + match.group(2) + ' / ' + match.group(3)
                 place = place + 1
             else: continue
             # img
             match = re.search('<img src="([^"]+?)"', item)
             if match: img = match.group(1)
             else: img = ''
             # plot
             match = re.search('<p[^>]*?>([^<]+?)</p>', item)
             if match: plot = match.group(1).strip()
             else: plot = ''
             
             params = { 'title': title, 'url': url, 'icon': img, 'plot': plot}
             self.addVideo(params)
开发者ID:samsamsam-iptvplayer,项目名称:iptvplayer-for-e2,代码行数:37,代码来源:hostalekinotv.py

示例14: getLink

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper import getDataBeetwenMarkers [as 别名]
 def getLink(self, url):
     printDBG("getLink url[%s]" % url)
     urlItem = url.split('|')
     if 3 == len(urlItem):
         url        = urlItem[0]
         post_data  = { 'action': 'getPlayer', 'id': urlItem[1], 'playerType': urlItem[2] }
         HEADER = dict(self.AJAX_HEADER)
         HEADER['Referer'] = url
         if 'free' == urlItem[2]:
             http_params = {'header': HEADER}
         else:
             http_params = {'header': HEADER, 'use_cookie': True, 'save_cookie': False, 'load_cookie': True, 'cookiefile': self.COOKIE_FILE}
             
         sts, data = self.cm.getPage( url, http_params, post_data)
         if not sts: return ''
         data = CParsingHelper.getDataBeetwenMarkers(data, '<div class="player">', '<div class="playerTypes">', False)[1]
         if 'free' == urlItem[2]:
             data = CParsingHelper.getSearchGroups(data, '<iframe [^>]*?src="([^"]+?)"')[0]
             sts, data = self.cm.getPage( data )
             if not sts: return ''
             data = CParsingHelper.getSearchGroups(data, '<iframe [^>]*?src="([^"]+?)"')[0]
             return self.up.getVideoLink( data )
         else:
             return CParsingHelper.getSearchGroups(data, 'url: [\'"](http[^\'"]+?)[\'"]')[0]
         return ''
     else:
         return url
开发者ID:samsamsam-iptvplayer,项目名称:iptvplayer-for-e2,代码行数:29,代码来源:hostplaytube.py

示例15: getHostingTable

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper import getDataBeetwenMarkers [as 别名]
 def getHostingTable(self, urlItem):
     printDBG("getHostingTable url[%s]" % urlItem['url'])
     # use cache if possible
     if 0 < len( self.linksCacheCache.get('tab', []) ) and (urlItem['url'] + urlItem.get('ver', '')) == self.linksCacheCache.get('marker', None):
         return self.linksCacheCache['tab']
         
     hostingTab = []
     # get lang tab
     langTab = []
     sts, data = self.cm.getPage( urlItem['url'] )
     if False == sts: return hostingTab
     data = CParsingHelper.getDataBeetwenMarkers(data, '<div class="langs">', '</div>', False)[1]
     data = re.compile('data-id="([^"]+?)"[^>]*?>(.+?)</a>', re.DOTALL).findall(data)
     for item in data:
         tmp = {'val': item[0], 'title': self.cleanHtmlStr(item[1])}
         if tmp['val'] == urlItem.get('ver', ''):
             langTab = [tmp]
             break
         else: langTab.append( tmp )
         
     for lang in langTab: 
         tmpTab = []
         if self.loggedIn:
             tmpTab = self.getLinks(urlItem['url'], lang, {'val': 'premium', 'title':'Premium'})
         if 0 == len(tmpTab):
             tmpTab = self.getLinks(urlItem['url'], lang, {'val': 'free', 'title':'Free'})
         hostingTab.extend(tmpTab)
     self.linksCacheCache = {'marker': urlItem['url'] + urlItem.get('ver', ''), 'tab': hostingTab}
     return hostingTab
开发者ID:samsamsam-iptvplayer,项目名称:iptvplayer-for-e2,代码行数:31,代码来源:hostplaytube.py


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