Пример #1
0
def LISTEPISODES(tvshowname,url):
    link=main.OPENURL(url)
    link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','')
    match = re.findall('<a class=".+?" href="(.+?)" id=".+?">(.+?)</a>',link)
    dialogWait = xbmcgui.DialogProgress()
    ret = dialogWait.create('Please wait until ['+tvshowname+'] Episodes are cached.')
    totalLinks = len(match)
    loadedLinks = 0
    remaining_display = 'Episodes loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
    dialogWait.update(0, '[B]Will load instantly from now on[/B]',remaining_display)
    xbmc.executebuiltin("XBMC.Dialog.Close(busydialog,true)")
    for url,name in match:
        if "Online" not in name: continue
        name=name.replace(tvshowname,'').replace('Watch Online','')
        name=main.removeNonASCII(name)
        main.addTVInfo(name,MainUrl+url,39,'','','') 
        loadedLinks = loadedLinks + 1
        percent = (loadedLinks * 100)/totalLinks
        remaining_display = 'Episodes loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
        dialogWait.update(percent,'[B]Will load instantly from now on[/B]',remaining_display)
        if dialogWait.iscanceled(): return False   
    match=re.findall('<div id="above_threadlist" class="above_threadlist">(.+?)</div>',link)
    for string in match:
        match1=re.findall('<a href="(.+?)" title="(.+?)">[0-9]+</a>', string)
        for url, page in match1:
            main.addTVInfo(page,MainUrl+url,38,'','','')
    dialogWait.close()
    del dialogWait
    xbmcplugin.setContent(int(sys.argv[1]), 'TV Shows')
    main.VIEWS()
Пример #2
0
def LISTSHOWS(murl,channel,index=False):
    link=main.OPENURL(murl)
    link=link.replace('\r','').replace('\n','').replace('\t','').replace('&nbsp;','')
    match = re.findall('<div class="titleline"><h2 class="forumtitle"><a href="(.+?)">(.+?)</a></h2></div>',link)
    label='TV Shows'
    if not len(match) > 0:
        match = re.findall('<h3 class="threadtitle">.+?<a class=".+?" href="(.+?)" id=".+?">(.+?)</a></h3>', link)
        label = 'Movies'
    dialogWait = xbmcgui.DialogProgress()
    ret = dialogWait.create('Please wait until ' + label + ' Show list is cached.')
    totalLinks = len(match)
    loadedLinks = 0
    remaining_display = label + ' loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
    dialogWait.update(0, '[B]Will load instantly from now on[/B]',remaining_display)
    xbmc.executebuiltin("XBMC.Dialog.Close(busydialog,true)")
    for url,name in match:
        if "color" in name:
            name=name.replace('<b><font color=red>','[COLOR red]').replace('</font></b>','[/COLOR]')
            name=name.replace('<b><font color="red">','[COLOR red]').replace('</font></b>','[/COLOR]')
        if label == 'Movies':
            main.addDirX(name, MainUrl+url,39,'',searchMeta=True, metaType='Movies')
        else:
            main.addTVInfo(name,MainUrl+url,38,getShowImage(channel,name),'','')
        loadedLinks = loadedLinks + 1
        percent = (loadedLinks * 100)/totalLinks
        remaining_display = label + ' loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
        dialogWait.update(percent,'[B]Will load instantly from now on[/B]',remaining_display)
        if dialogWait.iscanceled(): return False   
    dialogWait.close()
    del dialogWait
    xbmcplugin.setContent(int(sys.argv[1]), label)
    main.VIEWS()
Пример #3
0
def LISTSHOWS(murl, channel, index=False):
    link = main.OPENURL(murl)
    link = link.replace('\r',
                        '').replace('\n',
                                    '').replace('\t',
                                                '').replace('&nbsp;', '')
    match = re.findall(
        '<div class="titleline"><h2 class="forumtitle"><a href="(.+?)">(.+?)</a></h2></div>',
        link)
    label = 'TV Shows'
    if not len(match) > 0:
        match = re.findall(
            '<h3 class="threadtitle">.+?<a class=".+?" href="(.+?)" id=".+?">(.+?)</a></h3>',
            link)
        label = 'Movies'
    dialogWait = xbmcgui.DialogProgress()
    ret = dialogWait.create('Please wait until ' + label +
                            ' Show list is cached.')
    totalLinks = len(match)
    loadedLinks = 0
    remaining_display = label + ' loaded :: [B]' + str(
        loadedLinks) + ' / ' + str(totalLinks) + '[/B].'
    dialogWait.update(0, '[B]Will load instantly from now on[/B]',
                      remaining_display)
    xbmc.executebuiltin("XBMC.Dialog.Close(busydialog,true)")
    for url, name in match:
        if "color" in name:
            name = name.replace('<b><font color=red>',
                                '[COLOR red]').replace('</font></b>',
                                                       '[/COLOR]')
            name = name.replace('<b><font color="red">',
                                '[COLOR red]').replace('</font></b>',
                                                       '[/COLOR]')
        if label == 'Movies':
            main.addDirX(name,
                         MainUrl + url,
                         39,
                         '',
                         searchMeta=True,
                         metaType='Movies')
        else:
            main.addTVInfo(name, MainUrl + url, 38,
                           getShowImage(channel, name), '', '')
        loadedLinks = loadedLinks + 1
        percent = (loadedLinks * 100) / totalLinks
        remaining_display = label + ' loaded :: [B]' + str(
            loadedLinks) + ' / ' + str(totalLinks) + '[/B].'
        dialogWait.update(percent, '[B]Will load instantly from now on[/B]',
                          remaining_display)
        if dialogWait.iscanceled(): return False
    dialogWait.close()
    del dialogWait
    xbmcplugin.setContent(int(sys.argv[1]), label)
    main.VIEWS()
Пример #4
0
def LISTEPISODES(tvshowname, url):
    link = main.OPENURL(url)
    link = link.replace('\r',
                        '').replace('\n',
                                    '').replace('\t',
                                                '').replace('&nbsp;', '')
    match = re.findall('<a class=".+?" href="(.+?)" id=".+?">(.+?)</a>', link)
    dialogWait = xbmcgui.DialogProgress()
    ret = dialogWait.create('Please wait until [' + tvshowname +
                            '] Episodes are cached.')
    totalLinks = len(match)
    loadedLinks = 0
    remaining_display = 'Episodes loaded :: [B]' + str(
        loadedLinks) + ' / ' + str(totalLinks) + '[/B].'
    dialogWait.update(0, '[B]Will load instantly from now on[/B]',
                      remaining_display)
    xbmc.executebuiltin("XBMC.Dialog.Close(busydialog,true)")
    for url, name in match:
        if "Online" not in name: continue
        name = name.replace(tvshowname, '').replace('Watch Online', '')
        name = main.removeNonASCII(name)
        main.addTVInfo(name, MainUrl + url, 39, '', '', '')
        loadedLinks = loadedLinks + 1
        percent = (loadedLinks * 100) / totalLinks
        remaining_display = 'Episodes loaded :: [B]' + str(
            loadedLinks) + ' / ' + str(totalLinks) + '[/B].'
        dialogWait.update(percent, '[B]Will load instantly from now on[/B]',
                          remaining_display)
        if dialogWait.iscanceled(): return False
    match = re.findall(
        '<div id="above_threadlist" class="above_threadlist">(.+?)</div>',
        link)
    for string in match:
        match1 = re.findall('<a href="(.+?)" title="(.+?)">[0-9]+</a>', string)
        for url, page in match1:
            main.addTVInfo(page, MainUrl + url, 38, '', '', '')
    dialogWait.close()
    del dialogWait
    xbmcplugin.setContent(int(sys.argv[1]), 'TV Shows')
    main.VIEWS()