Example #1
0
def Browse_ItemAol(html, metamethod='', content='tvshows', view='515'):
    if (len(html) == 0):
        return
    html = GetDataBeetwenMarkers(html, 'Tytu', '</table>', False)[1]
    data = re.findall('<a href="/(.+?)">(.+?)</a>', html)
    ItemCount = len(data)
    for item in data:
        strona = mainSite4 + item[0] + '?page=0'
        name = item[1].encode("utf-8")
        ### scraper
        meta = metaget.get_meta('tvshow', name)
        fanart = str(meta['backdrop_url']).replace('u', '')
        img = str(meta['cover_url']).replace('u', '')
        plot = meta['plot']
        labs = {}
        try:
            labs['plot'] = plot
        except:
            labs['plot'] = ''


###
        pars = {
            'mode': 'EpisodesAnime',
            'site': site,
            'section': section,
            'title': name,
            'url': strona,
            'img': img,
            'fanart': fanart
        }
        contextLabs = {
            'title': name,
            'url': strona,
            'img': img,
            'fanart': fanart,
            'todoparams': _addon.build_plugin_url(pars),
            'site': site,
            'section': section,
            'plot': labs['plot']
        }
        if section == 'movie':
            contextMenuItems = ContextMenu_Movies(contextLabs)
        elif section == 'animeonline':
            contextMenuItems = ContextMenu_Series(contextLabs)
        elif section == 'animedrama':
            contextMenuItems = ContextMenu_Series(contextLabs)
        else:
            contextMenuItems = []
        labs['title'] = name
        _addon.add_directory(pars,
                             labs,
                             is_folder=True,
                             fanart=fanart,
                             img=img,
                             contextmenu_items=contextMenuItems,
                             total_items=ItemCount)
    set_view(content, view_mode=addst('tvshows-view'))
Example #2
0
def Browse_ItemAon(html, metamethod='', content='tvshows', view='515'):
    if (len(html) == 0):
        return
    data = re.findall("<img src='http://animeon.pl/images/anime_min/mins/(.+?)'(.+?)<a href='(.+?)'>(.+?)</a></strong>(.+?)<div>(.+?)</div>", html)
    ItemCount = len(data)
    for item in data:
            _url = item[2]
            name = item[3]
            img = 'http://animeon.pl/images/anime_min/' + item [0]
            fanart = fanartAol
            plot = item[5]
            labs = {}
            try:
                labs['plot'] = plot
            except:
                labs['plot'] = ''
###
            pars = {'mode': 'EpisodesAnimeon', 'site': site, 'section': section, 'title': name, 'url': _url, 'img': img, 'fanart': fanart}
            contextLabs = {'title': name, 'url': _url, 'img': img, 'fanart': fanart, 'todoparams': _addon.build_plugin_url(pars), 'site': site, 'section': section, 'plot': labs['plot']}
            if   section == 'movie':
                contextMenuItems = ContextMenu_Movies(contextLabs)
            elif section == 'animeon':
                contextMenuItems = ContextMenu_Series(contextLabs)
            else:
                contextMenuItems = []
            labs['title'] = name
            _addon.add_directory(pars, labs, is_folder=True, fanart=fanart, img=img, contextmenu_items=contextMenuItems, total_items=ItemCount)
# szukanie następnej strony
    npage = url[:-2] + str(int(url[-2:]) + 20)
    if -1 != html.find("div class='pagenav"):
            _addon.add_directory({'mode': 'Pageanimeon', 'site': site, 'section': section, 'url': npage, 'page': npage}, {'title': "Next page"}, is_folder=True, fanart=fanartAol, img=nexticon)
    set_view(content, view_mode=addst('tvshows-view'))
Example #3
0
def Pageshniden(url, nmr,  metamethod='', content='tvshows', view='515'):
    if 'search' in url:
        from common import getUserInput
        url = url + getUserInput('Szukaj','')
        html = nURL(url.replace(' ', '+'))
    else:
        html = nURL(url + nmr)
    html = GetDataBeetwenMarkers(html, 'data-view-table-cover', '<nav class="pagination">', False)[1]
    html = html.replace('\r\n', '')
    html = html.replace(' ', '')
    data = re.findall('src="(.+?)"/></td><tdclass="desc-col"><h3><ahref="(.+?)">(.+?)</a></h3>', html)
    ItemCount = len(data)
    for item in data:
        strona = mainSite5 + item[1]
        name = item[2].encode("utf-8")
        img = (mainSite5 + item[0]).replace('/resources/images/100x100/','/resources/images/genuine/')
        img = img.replace('100x100', '225x350')
        plot = ''
        fanart = fanartAol
        labs = {}
        try:
            labs['plot'] = plot
        except:
            labs['plot'] = ''
###
        pars = {'mode': 'EpisodesShniden', 'site': site, 'section': section, 'title': name, 'url': strona, 'img': img, 'fanart': fanart}
        contextLabs = {'title': name, 'url': strona, 'img': img, 'fanart': fanart, 'todoparams': _addon.build_plugin_url(pars), 'site': site, 'section': section, 'plot': labs['plot']}
        if   section == 'movie':
            contextMenuItems = ContextMenu_Movies(contextLabs)
        elif section == 'shnidenodc':
            contextMenuItems = ContextMenu_Series(contextLabs)
        else:
            contextMenuItems = []
        labs['title'] = name
        _addon.add_directory(pars, labs, is_folder=True, fanart=fanart, img=img, contextmenu_items=contextMenuItems, total_items=ItemCount)
    if not 'search' in url:
        npage = str(int(nmr) + 1)
        print npage
#    if -1 != html.find("do strony "):
        _addon.add_directory({'mode': 'Pageshniden', 'site': site, 'section': section, 'url': url, 'page': url, 'nmr': npage}, {'title': "Next page"}, is_folder=True, fanart=fanartAol, img=nexticon)
    set_view(content, view_mode=addst('links-view'))
    eod()
Example #4
0
def Browse_ItemShniden(html, metamethod='', content='tvshows', view='515'):
    if (len(html) == 0):
        return
    idx = html.find('<dl class="sub-nav">')
    if idx == -1:
        return
    idx2 = html.find('</body>', idx)
    if idx2 == -1:
        return
    html = html[idx:idx2]
    r = re.compile('<a href="(.+?.html)">(.+?) </a>').findall(html)
    ItemCount = len(r)
    if len(r) > 0:
        for _url, _tytul in r:
            _name2 = html_entity_decode(_tytul)
            strona = _url
            ### scraper
            meta = metaget.get_meta('tvshow', _name2)
            fanart = str(meta['backdrop_url']).replace('u', '')
            img = str(meta['cover_url']).replace('u', '')
            plot = meta['plot']
            labs = {}
            try:
                labs['plot'] = plot
            except:
                labs['plot'] = ''


###
            pars = {
                'mode': 'EpisodesShniden',
                'site': site,
                'section': section,
                'title': _name2,
                'url': strona,
                'img': img,
                'fanart': fanart
            }
            contextLabs = {
                'title': _name2,
                'url': strona,
                'img': img,
                'fanart': fanart,
                'todoparams': _addon.build_plugin_url(pars),
                'site': site,
                'section': section,
                'plot': labs['plot']
            }
            if section == 'movie':
                contextMenuItems = ContextMenu_Movies(contextLabs)
            elif section == 'shnidenodc':
                contextMenuItems = ContextMenu_Series(contextLabs)
            else:
                contextMenuItems = []
            labs['title'] = _name2
            _addon.add_directory(pars,
                                 labs,
                                 is_folder=True,
                                 fanart=fanart,
                                 img=img,
                                 contextmenu_items=contextMenuItems,
                                 total_items=ItemCount)
    set_view(content, view_mode=addst('tvshows-view'))
def Browse_Itemscen(html, metamethod='', content='tvshows', view='515'):
    if (len(html) == 0):
        return
    r = re.compile(
        '<a href="http://anime-centrum.net/(.+?)" class="tip-(.+?) tip-style-2"'
    ).findall(html)
    ItemCount = len(r)
    if len(r) > 0:
        for _url, _x in r:
            strona = 'http://anime-centrum.net/' + _url
            html2 = nURL(strona)
            #  nazwa
            tytul = re.compile(
                '<meta property="og:title" content="(.+?)" />').findall(html2)
            ItemCount = len(tytul)
            if len(tytul) > 0:
                for _tytul in tytul:
                    _name2 = _tytul.encode('utf-8')
#  grafika
            image = re.compile(
                '<meta property="og:image" content="(.+?)" />').findall(html2)
            ItemCount = len(image)
            if len(image) > 0:
                for foto in image:
                    img = foto
            else:
                img = ""
#  fanart
            image3 = re.compile('http:(.+?).jpg').findall(html2)
            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(html2)
            ItemCount = len(opis)
            if len(opis) > 0:
                for desc in opis:
                    plot = desc
            labs = {}
            try:
                labs['plot'] = plot
            except:
                labs['plot'] = ''


###
            pars = {
                'mode': 'EpisodesCentrum',
                'site': site,
                'section': section,
                'title': _name2,
                'url': strona,
                'img': img,
                'fanart': fanart
            }
            contextLabs = {
                'title': _name2,
                'url': strona,
                'img': img,
                'fanart': fanart,
                'todoparams': _addon.build_plugin_url(pars),
                'site': site,
                'section': section,
                'plot': labs['plot']
            }
            if section == 'movie':
                contextMenuItems = ContextMenu_Movies(contextLabs)
            elif section == 'animecentrum':
                contextMenuItems = ContextMenu_Series(contextLabs)
            else:
                contextMenuItems = []
            labs['title'] = _name2
            _addon.add_directory(pars,
                                 labs,
                                 is_folder=True,
                                 fanart=fanart,
                                 img=img,
                                 contextmenu_items=contextMenuItems,
                                 total_items=ItemCount)
    set_view(content, view_mode=addst('tvshows-view'))
Example #6
0
def Browse_Items(html, metamethod='', content='tvshows', view='515'):
    if (len(html) == 0):
        return
    r = re.compile("</a><div class='con'><a href='/(.+?)'>(.+?)</a><p>").findall(html)
    ItemCount = len(r)
    if len(r) > 0:
        for _url, _name in r:
            strona = 'http://diff-anime.pl/' + _url
            html2 = nURL(strona)
            _name2 = _name
#  grafika
            image = re.compile("</div><div class='content'><div class='con'><a href='(.+?)' class='fbox'>").findall(html2)
            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 html2:
                fanart = fanartSite
            else:
                    image2 = re.compile("<h2>Kadry</h2></div><div class='content'><a href='(.+?)' class='fbox'>").findall(html2)
                    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(html2)
            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(html2)
                    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(html2)
                            ItemCount = len(opis)
                            if len(opis) > 0:
                                for desc in opis:
                                    plot = unicode(desc,"utf-8")
                            else:
                                    plot = "Nie dodano jeszcze opisu do tej serii."
            labs = {}
            try:
                labs['plot'] = plot
            except:
                labs['plot'] = ''
###
            pars = {'mode': 'EpisodesDiff', 'site': site, 'section': section, 'title': _name2, 'url': strona, 'img': img, 'fanart': fanart}
            contextLabs = {'title': _name2, 'url': strona, 'img': img, 'fanart': fanart, 'todoparams': _addon.build_plugin_url(pars), 'site': site, 'section': section, 'plot': labs['plot']}
            if   section == 'movie':
                contextMenuItems = ContextMenu_Movies(contextLabs)
            elif section == 'diffanime':
                contextMenuItems = ContextMenu_Series(contextLabs)
            else:
                contextMenuItems = []
            labs['title'] = _name2
            _addon.add_directory(pars, labs, is_folder=True, fanart=fanart, img=img, contextmenu_items=contextMenuItems, total_items=ItemCount)
# szukanie następnej strony
    npage = url[:-2] + str(int(url[-2:]) + 10)
    if -1 != html.find("div class='pagenav") and -1 != html.find("class='img"):
            _addon.add_directory({'mode': 'Page', 'site': site, 'section': section, 'url': npage, 'page': npage}, {'title': "Next page"}, is_folder=True, fanart=fanartSite, img=nexticon)
    set_view(content, view_mode=addst('tvshows-view'))