Пример #1
0
def get_links(match, plot=""):
    logger.info("[sports-lshunter.py] get_links")
    itemlist = []

    matches2 = re.compile('<tr class="sectiontable([^"]+)">(.*?)</tr>',re.DOTALL).findall(match)
    for section,inner in matches2:
        if (SPT.DEBUG): logger.info("innerlshlinks="+inner)
        if section == 'header':
            section_name = scrapertools.find_single_match(inner,'<td>([^<]+)</td>')
        else:
            server_name = scrapertools.find_single_match(inner,'<td width="80"><a>([^:]+)')
            server_name_fmt = SPT.formatear_server(server_name, 1) if section_name != 'Other Links:' and server_name != 'Flash' else SPT.formatear_server(server_name)

            matches3 = re.compile('href=["\']javascript:openWindow\(["\']([^"\']+)',re.DOTALL | re.IGNORECASE).findall(inner)
            for n, scrapedurl in enumerate(matches3):
                desglose = scrapertools.find_single_match(scrapedurl,'event_id=([^&]+)&tv_id=([^&]+)&tid=([^&]+)&channel=([^&]+)&')
                if len(desglose) == 4:
                    event_id,tv_id,tid,chan = desglose
                else:
                    event_id,tid,chan = scrapertools.find_single_match(scrapedurl,'event_id=([^&]+)&tid=([^&]+)&channel=([^&]+)&')
                    tv_id = '0'
                url = 'http://live.drakulastream.eu/static/popups/%s%s%s%s.html' % (event_id,tv_id,tid,chan)
                titulo = section_name + ' [' + server_name_fmt + '~' + str(n+1) + ']'
                if (SPT.DEBUG): logger.info("LINK: "+section_name+" : "+server_name+" : "+scrapedurl+" :: "+url)
                itemlist.append( Item(channel="sports-main", action="play" , title=titulo , url=url, plot=plot))

            matches3 = re.compile('href=["\'](http://live.drakulastream.eu/players/[^"\']+)',re.DOTALL).findall(inner)
            for n, url in enumerate(matches3):
                titulo = section_name + ' ' + server_name_fmt + '-' + str(n+1)
                if (SPT.DEBUG): logger.info("LINK: "+section_name+" : "+server_name+" : "+url)
                itemlist.append( Item(channel="sports-main", action="play" , title=titulo , url=url, plot=plot))

    return itemlist
Пример #2
0
def get_links(match, plot=""):
    logger.info("[sports-rojadirecta.py] get_links")
    itemlist = []

    patron2 = '<tr>\s*<td>NO</td>\s*<td>(?!bwin|bet365)([^<]*)</td>\s*<td>([^<]*)</td>\s*<td>([^<]*).*?</td>\s*<td>(.*?)</td>\s*<td>(?:<b>)?<a[^>]*href="([^"]+)"'
    matches2 = re.compile(patron2, re.DOTALL).findall(match)
    for nombre, idioma, tipo, calidad, enlace in matches2:
        tipo = tipo.strip()
        calidad = calidad.replace("<!--9000-->", "").replace(' (<span class="es">e</span>stable)', "")
        titulo = nombre + " - " + idioma + " - " + calidad + " kbps - " + SPT.formatear_server(tipo)
        url = enlace.replace("#www.rojadirecta.me", "").replace("goto/", "http://")
        itemlist.append(Item(channel="sports-main", action="play", title=titulo, url=url, plot=plot, extra=calidad))

    return sorted(itemlist, key=lambda k: int(k.extra), reverse=True)  # ordenada por calidad
Пример #3
0
def get_links(match, plot=""):
    logger.info("[sports-rojadirecta.py] get_links")
    itemlist = []

    patron2 = '<tr>\s*<td>NO</td>\s*<td>(?!bwin|bet365)([^<]*)</td>\s*<td>([^<]*)</td>\s*<td>([^<]*).*?</td>\s*<td>(.*?)</td>\s*<td>(?:<b>)?<a[^>]*href="([^"]+)"'
    matches2 = re.compile(patron2, re.DOTALL).findall(match)
    for nombre, idioma, tipo, calidad, enlace in matches2:
        tipo = tipo.strip()
        calidad = calidad.replace('<!--9000-->', '').replace(
            ' (<span class="es">e</span>stable)', '')
        titulo = nombre + ' - ' + idioma + ' - ' + calidad + ' kbps - ' + SPT.formatear_server(
            tipo)
        url = enlace.replace('#www.rojadirecta.me',
                             '').replace('goto/', 'http://')
        itemlist.append(
            Item(channel="sports-main",
                 action="play",
                 title=titulo,
                 url=url,
                 plot=plot,
                 extra=calidad))

    return sorted(itemlist, key=lambda k: int(k.extra),
                  reverse=True)  #ordenada por calidad