diff --git a/plugin.video.alfa/channels/doramasmp4.py b/plugin.video.alfa/channels/doramasmp4.py index 7926eeee..3f6139a1 100644 --- a/plugin.video.alfa/channels/doramasmp4.py +++ b/plugin.video.alfa/channels/doramasmp4.py @@ -40,7 +40,7 @@ def mainlist(item): itemlist.append(Item(channel=item.channel, title="Películas", action="list_all", url=host + 'catalogue?format=pelicula', thumbnail=get_thumb('movies', auto=True), type='movie')) - itemlist.append(Item(channel=item.channel, title = 'Buscar', action="search", url= host+'search?q=', + itemlist.append(Item(channel=item.channel, title = 'Buscar', action="search", url= host+'ajax/search.php', thumbnail=get_thumb('search', auto=True))) autoplay.show_option(item.channel, itemlist) @@ -81,10 +81,9 @@ def list_all(item): else: new_item.contentSerieName=scrapedtitle - new_item.action = 'episodes' + new_item.action = 'episodios' itemlist.append(new_item) - tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) # Paginacion @@ -101,6 +100,33 @@ def list_all(item): return itemlist +def search_results(item): + logger.info() + + itemlist=[] + data = httptools.downloadpage(item.url, post=item.post).data + data = re.sub(r'"|\n|\r|\t| |
|\s{2,}', "", data) + patron = '.*?500>(.*?)' + patron += '
(.*?)
.*?200>(.*?)' + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, scrapedthumbnail, scrapedtitle, year, scrapedtype in matches: + new_item = Item(channel=item.channel, url=scrapedurl, thumbnail=scrapedthumbnail, title=scrapedtitle) + + if scrapedtype != 'dorama': + new_item.action = 'findvideos' + new_item.contentTitle = scrapedtitle + + else: + new_item.contentSerieName=scrapedtitle + new_item.action = 'episodios' + itemlist.append(new_item) + + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + + return itemlist + + def latest_episodes(item): logger.info() itemlist = [] @@ -121,11 +147,10 @@ def latest_episodes(item): return itemlist -def episodes(item): +def episodios(item): logger.info() itemlist = [] data = get_source(item.url) - logger.debug(data) patron = '