コード例 #1
0
ファイル: desitv.py プロジェクト: cmdnath/innovate-dev
def LISTSHOWS(murl, channel, CachePath, index=False):
    cacheFilePath = os.path.join(CachePath, cacheFileName)
    channel = channel.replace("[COLOR red]", "").replace(" Past Shows[/COLOR]", "")
    label = "TV Show"
    if re.search("movie", murl, re.I):
        label = "Movies"
    if checkCache(murl, channel, cacheFilePath):
        buildCache(murl, channel, cacheFilePath, index)
        loadFromCache(murl, channel, cacheFilePath)
    else:
        loadFromCache(murl, channel, cacheFilePath)
    xbmcplugin.setContent(int(sys.argv[1]), label)
    if label == "Movies":
        main.setSeasonView()
    else:
        main.VIEWS()
コード例 #2
0
ファイル: desitv.py プロジェクト: cmdnath/innovate-dev
def LISTSHOWS(murl, channel, CachePath, index=False):
    cacheFilePath = os.path.join(CachePath, cacheFileName)
    channel = channel.replace('[COLOR red]',
                              '').replace(' Past Shows[/COLOR]', '')
    label = 'TV Show'
    if re.search('movie', murl, re.I):
        label = 'Movies'
    if checkCache(murl, channel, cacheFilePath):
        buildCache(murl, channel, cacheFilePath, index)
        loadFromCache(murl, channel, cacheFilePath)
    else:
        loadFromCache(murl, channel, cacheFilePath)
    xbmcplugin.setContent(int(sys.argv[1]), label)
    if label == 'Movies':
        main.setSeasonView()
    else:
        main.VIEWS()
コード例 #3
0
ファイル: sominal.py プロジェクト: cmdnath/innovate-dev
def LISTMOVIES(murl, name, index, page=1):
    turl = murl

    totalMoviesToLoad = settings.getNoOfMoviesToLoad()

    dialogWait = xbmcgui.DialogProgress()

    ret = dialogWait.create("Please wait until [Movies] are cached.")
    loadedLinks = 0
    totalLinks = totalMoviesToLoad
    remaining_display = "Movies 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)")

    quality = None
    hindiMovie = False
    year = None
    pagesScanned = 0
    while (pagesScanned < 5) and (loadedLinks <= totalMoviesToLoad):
        purl = turl
        if int(page) > 1:
            purl = turl + "?paged=" + str(page)
        link = main.OPENURL(purl)
        soup = BeautifulSoup.BeautifulSoup(link).findAll("item")
        for item in soup:
            quality = ""
            hindiMovie = False
            year = ""

            name = item.title.text
            url = item.comments.text.replace("#comments", "")
            for category in item.findAll("category"):
                if category.text == "Hindi Movies":
                    # print item
                    hindiMovie = True
                elif re.search("DVD", category.text, flags=re.I):
                    quality = " [COLOR red][DVD][/COLOR] "
                elif re.search("/*BluRay/*", category.text, flags=re.I):
                    quality = " [COLOR red][HD][/COLOR] "
                elif re.search("[1-2][0,9][0-9][0-9]", category.text, flags=re.I):
                    year = category.text
                if dialogWait.iscanceled():
                    return False
            if dialogWait.iscanceled():
                return False
            if hindiMovie:
                pagesScanned = 0
                main.addDirX(
                    name + quality, url, constants.SOMINAL_LOADVIDEOS, "", searchMeta=True, metaType="Movies", year=year
                )
                loadedLinks = loadedLinks + 1
                percent = (loadedLinks * 100) / totalLinks
                remaining_display = "Movies loaded :: [B]" + str(loadedLinks) + " / " + str(totalLinks) + "[/B]."
                dialogWait.update(percent, "[B]Will load instantly from now on[/B]", remaining_display)
                if loadedLinks >= totalLinks:
                    print "BREAKING"
                    break
                if dialogWait.iscanceled():
                    return False
        if dialogWait.iscanceled():
            return False
        page = str(int(page) + 1)
        pagesScanned = pagesScanned + 1
    dialogWait.close()
    del dialogWait

    main.addDir(
        "[COLOR blue]Next[/COLOR]", murl, constants.SOMINAL_LISTMOVIES, art + "/next.png", index=index, page=str(page)
    )
    xbmcplugin.setContent(int(sys.argv[1]), "Movies")
    main.setSeasonView()
コード例 #4
0
def LISTMOVIES(murl, name, index, page=1):
    turl = murl

    totalMoviesToLoad = settings.getNoOfMoviesToLoad()

    dialogWait = xbmcgui.DialogProgress()

    ret = dialogWait.create('Please wait until [Movies] are cached.')
    loadedLinks = 0
    totalLinks = totalMoviesToLoad
    remaining_display = 'Movies 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)")

    quality = None
    hindiMovie = False
    year = None
    pagesScanned = 0
    while ((pagesScanned < 5) and (loadedLinks <= totalMoviesToLoad)):
        purl = turl
        if int(page) > 1:
            purl = turl + "?paged=" + str(page)
        link = main.OPENURL(purl)
        soup = BeautifulSoup.BeautifulSoup(link).findAll('item')
        for item in soup:
            quality = ''
            hindiMovie = False
            year = ''

            name = item.title.text
            url = item.comments.text.replace('#comments', '')
            for category in item.findAll('category'):
                if category.text == 'Hindi Movies':
                    #print item
                    hindiMovie = True
                elif re.search('DVD', category.text, flags=re.I):
                    quality = ' [COLOR red][DVD][/COLOR] '
                elif re.search('/*BluRay/*', category.text, flags=re.I):
                    quality = ' [COLOR red][HD][/COLOR] '
                elif re.search('[1-2][0,9][0-9][0-9]',
                               category.text,
                               flags=re.I):
                    year = category.text
                if dialogWait.iscanceled(): return False
            if dialogWait.iscanceled(): return False
            if hindiMovie:
                pagesScanned = 0
                main.addDirX(name + quality,
                             url,
                             constants.SOMINAL_LOADVIDEOS,
                             '',
                             searchMeta=True,
                             metaType='Movies',
                             year=year)
                loadedLinks = loadedLinks + 1
                percent = (loadedLinks * 100) / totalLinks
                remaining_display = 'Movies loaded :: [B]' + str(
                    loadedLinks) + ' / ' + str(totalLinks) + '[/B].'
                dialogWait.update(percent,
                                  '[B]Will load instantly from now on[/B]',
                                  remaining_display)
                if loadedLinks >= totalLinks:
                    print 'BREAKING'
                    break
                if dialogWait.iscanceled(): return False
        if dialogWait.iscanceled(): return False
        page = str(int(page) + 1)
        pagesScanned = pagesScanned + 1
    dialogWait.close()
    del dialogWait

    main.addDir('[COLOR blue]Next[/COLOR]',
                murl,
                constants.SOMINAL_LISTMOVIES,
                art + '/next.png',
                index=index,
                page=str(page))
    xbmcplugin.setContent(int(sys.argv[1]), 'Movies')
    main.setSeasonView()