def listEpisodes(args): """Show all episodes of an season/arc """ response = urllib2.urlopen("https://www.akibapass.de" + args.url) html = response.read() soup = BeautifulSoup(html, "html.parser") for season in soup.findAll(text=args.title): parent = season.find_parent("li") if not parent: continue thumb = parent.img["src"].replace(" ", "%20") if thumb[:4] != "http": thumb = "https:" + thumb view.add_item(args, { "url": parent.a["href"], "title": parent.img["alt"].encode("utf-8"), "mode": "videoplay", "thumb": args.thumb.replace(" ", "%20"), "fanart": args.fanart.replace(" ", "%20") }, isFolder=False, mediatype="video") view.endofdirectory()
def myCollection(args): """View collection """ response = urllib2.urlopen("https://www.akibapass.de/de/v2/collection") html = response.read() soup = BeautifulSoup(html, "html.parser") container = soup.find("div", {"class": "big-item-list"}) if not container: view.endofdirectory() return for div in container.find_all("div", {"class": "big-item-list_item"}): thumb = div.img["src"].replace(" ", "%20") if thumb[:4] != "http": thumb = "https:" + thumb view.add_item(args, { "url": div.a["href"].replace("collection/detail", "catalogue/show"), "title": div.find("h3", { "class": "big-item_title" }).string.strip().encode("utf-8"), "mode": "list_season", "thumb": thumb, "fanart": thumb }, isFolder=True, mediatype="video") view.endofdirectory()
def searchAnime(args): """Search for animes """ d = xbmcgui.Dialog().input(args._addon.getLocalizedString(30021), type=xbmcgui.INPUT_ALPHANUM) if not d: return post_data = urllib.urlencode({"search": d}) response = urllib2.urlopen( "https://www.wakanim.tv/" + args._country + "/v2/catalogue/search", post_data) html = response.read() soup = BeautifulSoup(html, "html.parser") ul = soup.find("ul", {"class": "catalog_list"}) if not ul: view.endofdirectory() return for li in ul.find_all("li"): plot = li.find("p", {"class": "tooltip_text"}) stars = li.find("div", {"class": "stars"}) star = stars.find_all("span", {"class": "-no"}) thumb = li.img["src"].replace(" ", "%20") if thumb[:4] != "http": thumb = "https:" + thumb view.add_item(args, { "url": li.a["href"], "title": li.find("div", { "class": "slider_item_description" }).span.strong.string.strip().encode("utf-8"), "mode": "list_season", "thumb": thumb, "fanart": thumb, "rating": str(10 - len(star) * 2), "plot": plot.contents[3].string.strip().encode("utf-8"), "year": li.time.string.strip().encode("utf-8") }, isFolder=True, mediatype="video") view.endofdirectory()
def showCatalog(args): """Show all animes """ response = urllib2.urlopen("https://www.wakanim.tv/" + args._country + "/v2/catalogue") html = response.read() soup = BeautifulSoup(html, "html.parser") ul = soup.find("ul", {"class": "catalog_list"}) for li in ul.find_all("li"): plot = li.find("p", {"class": "tooltip_text"}) stars = li.find("div", {"class": "stars"}) star = stars.find_all("span", {"class": "-no"}) thumb = li.img["src"].replace(" ", "%20") if thumb[:4] != "http": thumb = "https:" + thumb view.add_item(args, { "url": li.a["href"], "title": li.find("div", { "class": "slider_item_description" }).span.strong.string.strip().encode("utf-8"), "tvshowtitle": li.find("div", { "class": "slider_item_description" }).span.strong.string.strip().encode("utf-8"), "mode": "list_season", "thumb": thumb, "fanart": thumb, "rating": str(10 - len(star) * 2), "plot": plot.contents[3].string.strip().encode("utf-8"), "year": li.time.string.strip().encode("utf-8") }, isFolder=True, mediatype="video") view.endofdirectory()
def showMainMenue(args): """Show main menu """ view.add_item(args, { "title": args._addon.getLocalizedString(30020), "mode": "catalog" }) view.add_item(args, { "title": args._addon.getLocalizedString(30021), "mode": "search" }) view.add_item(args, { "title": args._addon.getLocalizedString(30022), "mode": "downloads" }) view.add_item(args, { "title": args._addon.getLocalizedString(30023), "mode": "collection" }) view.endofdirectory()
def myDownloads(args): """View download able animes May not every episode is download able. """ response = urllib2.urlopen("https://www.wakanim.tv/" + args._country + "/v2/mydownloads") html = response.read() soup = BeautifulSoup(html, "html.parser") container = soup.find("div", {"class": "big-item-list"}) if not container: view.endofdirectory() return for div in container.find_all("div", {"class": "big-item-list_item"}): thumb = div.img["src"].replace(" ", "%20") if thumb[:4] != "http": thumb = "https:" + thumb view.add_item(args, { "url": div.a["href"].replace("mydownloads/detail", "catalogue/show"), "title": div.find("h3", { "class": "big-item_title" }).string.strip().encode("utf-8"), "mode": "list_season", "thumb": thumb, "fanart": thumb }, isFolder=True, mediatype="video") view.endofdirectory()
def listSeason(args): """Show all seasons/arcs of an anime """ response = urllib2.urlopen("https://www.akibapass.de" + args.url) html = response.read() soup = BeautifulSoup(html, "html.parser") date = soup.find_all("span", {"class": "border-list_text"})[0].find_all("span") year = date[2].string.strip().encode("utf-8") date = year + "-" + date[1].string.strip().encode( "utf-8") + "-" + date[0].string.strip().encode("utf-8") originaltitle = soup.find_all( "span", {"class": "border-list_text"})[1].string.strip().encode("utf-8") studio = soup.find_all( "span", {"class": "border-list_text"})[2].string.strip().encode("utf-8") plot = soup.find("div", { "class": "serie_description" }).string.strip().encode("utf-8") credits = soup.find("div", { "class": "serie_description_more" }).p.string.strip().encode("utf-8") try: trailer = soup.find("span", {"class": "js-video-open"})["data-video"] trailer = "plugin://plugin.video.youtube/play/?video_id=" + trailer view.add_item(args, { "url": trailer, "mode": "trailer", "thumb": args.thumb.replace(" ", "%20"), "fanart": args.fanart.replace(" ", "%20"), "title": args._addon.getLocalizedString(30024) }, isFolder=False, mediatype="video") except TypeError: trailer = "" for section in soup.find_all("h2", {"class": "slider-section_title"}): if not section.span: continue title = section.get_text()[6:].strip() view.add_item(args, { "url": args.url, "title": title.encode("utf-8"), "mode": "list_episodes", "thumb": args.thumb.replace(" ", "%20"), "fanart": args.fanart.replace(" ", "%20"), "season": title.encode("utf-8"), "plot": plot, "plotoutline": getattr(args, "plot", ""), "studio": studio, "year": year, "premiered": date, "trailer": trailer, "originaltitle": originaltitle, "credits": credits }, isFolder=True, mediatype="video") view.endofdirectory()