def Browse_EpisodesCentrum(url,page='',content='episodes',view='515'):
    if url == '':
        return
    html = nURL(url)
    html = messupText(html, True, True)
    s = '<a href="http://(.+?)">Odcinek(.+?)</a>'
    matches = re.compile(s).findall(html)
    ItemCount = len(matches)
    if ItemCount > 0:
        for _url, _nazwa in matches:
            _url2 = 'http://' + urllib.quote(_url)
            _name = 'Odcinek' + _nazwa
            _title = '' + cFL_(_name)
#  grafika
            image = re.compile('<meta property="og:image" content="(.+?)" />').findall(html)
            ItemCount = len(image)
            if len(image) > 0:
                for foto in image:
                    img = foto
            else:
                img = ""
#  fanart
            image2 = re.compile('<!--dle_image_begin:(.+?)</a><!--dle_image_end-->').findall(html)
            ItemCount = len(image2)
            if len(image2) > 0:
                for foto2 in image2:
                    strona2 = foto2
                    image3 = re.compile('http:(.+?).jpg').findall(strona2)
                    ItemCount = len(image3)
                    if len(image3) > 0:
                        for foto3 in image3:
                            fanart = "http:" + foto3 + ".jpg"
                    else:
                        fanart = img
#  opis
            opis = re.compile('<strong>Opis:</strong>(.+)').findall(html)
            ItemCount = len(opis)
            if len(opis) > 0:
                for desc in opis:
                    plot = desc
            labs = {}
            try:
                labs['plot'] = plot
            except:
                labs['plot'] = ''
#  wyciąganie linku do mp4
            html2 = nURL(_url2)
            _link = re.compile('file: "(.+?)"').findall(html2)
#            _link = re.compile("<source src='(.+?)' type='video/mp4' />").findall(html2)
            ItemCount = len(_link)
            if len(_link) > 0:
                for link in _link:
                    strona = link.replace(' ', '%20')
###
            contextLabs = {'title': _name, 'year': '0000', 'url': _url2, 'img': img, 'fanart': fanart, 'DateAdded': '', 'plot': labs['plot']}
            contextMenuItems = ContextMenu_Episodes(labs=contextLabs)
            pars = {'mode': 'PlayFromHost', 'site': site, 'section': section, 'title': _name, 'url': strona, 'img': img, 'fanart': fanart}
            labs['title'] = _title
            _addon.add_directory(pars, labs, is_folder=False, fanart=fanart, img=img, contextmenu_items=contextMenuItems, total_items=ItemCount)
    set_view(content, int(addst('links-view')))
    eod()
def Browse_EpisodesCentrum(url, page='', content='episodes', view='515'):
    if url == '':
        return
    html = nURL(url)
    html = messupText(html, True, True)
    s = '<a href="http://(.+?)">Odcinek(.+?)</a>'
    matches = re.compile(s).findall(html)
    ItemCount = len(matches)
    if ItemCount > 0:
        for _url, _nazwa in matches:
            _url2 = 'http://' + urllib.quote(_url)
            _name = 'Odcinek' + _nazwa
            _title = '' + cFL_(_name)
            #  grafika
            image = re.compile(
                '<meta property="og:image" content="(.+?)" />').findall(html)
            ItemCount = len(image)
            if len(image) > 0:
                for foto in image:
                    img = foto
            else:
                img = ""
#  fanart
            image2 = re.compile(
                '<!--dle_image_begin:(.+?)</a><!--dle_image_end-->').findall(
                    html)
            ItemCount = len(image2)
            if len(image2) > 0:
                for foto2 in image2:
                    strona2 = foto2
                    image3 = re.compile('http:(.+?).jpg').findall(strona2)
                    ItemCount = len(image3)
                    if len(image3) > 0:
                        for foto3 in image3:
                            fanart = "http:" + foto3 + ".jpg"
                    else:
                        fanart = img
#  opis
            opis = re.compile('<strong>Opis:</strong>(.+)').findall(html)
            ItemCount = len(opis)
            if len(opis) > 0:
                for desc in opis:
                    plot = desc
            labs = {}
            try:
                labs['plot'] = plot
            except:
                labs['plot'] = ''
#  wyciąganie linku do mp4
            html2 = nURL(_url2)
            _link = re.compile('file: "(.+?)"').findall(html2)
            #            _link = re.compile("<source src='(.+?)' type='video/mp4' />").findall(html2)
            ItemCount = len(_link)
            if len(_link) > 0:
                for link in _link:
                    strona = link.replace(' ', '%20')
###
            contextLabs = {
                'title': _name,
                'year': '0000',
                'url': _url2,
                'img': img,
                'fanart': fanart,
                'DateAdded': '',
                'plot': labs['plot']
            }
            contextMenuItems = ContextMenu_Episodes(labs=contextLabs)
            pars = {
                'mode': 'PlayFromHost',
                'site': site,
                'section': section,
                'title': _name,
                'url': strona,
                'img': img,
                'fanart': fanart
            }
            labs['title'] = _title
            _addon.add_directory(pars,
                                 labs,
                                 is_folder=False,
                                 fanart=fanart,
                                 img=img,
                                 contextmenu_items=contextMenuItems,
                                 total_items=ItemCount)
    set_view(content, int(addst('links-view')))
    eod()
Example #3
0
def Browse_EpisodesDiff(url, page='', content='episodes', view='515'):
    html = gethtml.get(url + '/odcinki', addonPath)
    htmlplot = gethtml.get(url , addonPath)
    html = messupText(html, ciastko, True, True)
    s = "#(.+?)</div><div class=.+?</div><div class='con3'><a href='(.+?)' class='i'>"
    matches = re.compile(s).findall(html)
    ItemCount = len(matches)
    if ItemCount > 0:
        for  _nazwa, _url in matches:
            _url2 = 'http://diff-anime.pl' + _url
            _name = 'Odcinek' + _nazwa
            _title = '' + _name
#  grafika
            image = re.compile("</div><div class='content'><div class='con'><a href='(.+?)' class='fbox'>").findall(html)
            ItemCount = len(image)
            if len(image) > 0:
                for foto in image:
                    img = "http://diff-anime.pl" + foto
            else:
                    img = ""
#  fanart
            if "Nie dodano kadrów do tej serii." in html:
                fanart = fanartSite
            else:
                image2 = re.compile("<h2>Kadry</h2></div><div class='content'><a href='(.+?)' class='fbox'>").findall(html)
                ItemCount = len(image)
                if len(image) > 0:
                    for _fanart in image2:
                        fanart = "http://diff-anime.pl" + _fanart
                else:
                        fanart = img
#  opis
            opis = re.compile("<h2>Opis anime</h2></div><div class='content'><div class='con'>(.+?)</div>").findall(htmlplot)
            ItemCount = len(opis)
            if len(opis) > 0:
                for desc in opis:
                    plot = unicode(desc,"utf-8")
            else:
                    opis = re.compile("<h2>Opis anime</h2></div><div class='content'><div class='con'>(.+?)<").findall(htmlplot)
                    ItemCount = len(opis)
                    if len(opis) > 0:
                        for desc in opis:
                            plot = unicode(desc,"utf-8")
                    else:
                            opis = re.compile("<div id='pDesc' class='panel'><div class='head'><h2>Opis anime</h2></div><div class='content'><div class='con'>(.+?)<br />").findall(htmlplot)
                            ItemCount = len(opis)
                            if len(opis) > 0:
                                for desc in opis:
                                    plot = unicode(desc,"utf-8")
                            else:
                                    plot = ""
            labs = {}
            try:
                labs['plot'] = plot
            except:
                labs['plot'] = ''
#  wyciąganie linku do mp4
            html2 = gethtml.get(_url2, addonPath)
            _link = re.compile("'file': '(.+?)',").findall(html2)
            ItemCount = len(_link)
            if len(_link) > 0:
                for link in _link:
                    strona = link.replace(' ', '%20')
###
            contextLabs = {'title': _name, 'year': '0000', 'url': _url2, 'img': img, 'fanart': fanart, 'DateAdded': '', 'plot': labs['plot']}
            contextMenuItems = ContextMenu_Episodes(labs=contextLabs)
            pars = {'mode': 'PlayFromHost', 'site': site, 'section': section, 'title': _name, 'url': strona, 'img': img, 'fanart': fanart}
            labs['title'] = _title
            _addon.add_directory(pars, labs, is_folder=False, fanart=fanart, img=img, contextmenu_items=contextMenuItems, total_items=ItemCount)
    set_view(content, int(addst('links-view')))
    eod()