def item(params): info = scrapper.get_info(params["item"]) xbmc_info = scrapper.xbmc_info(info) page = util.request(info["trailers_url"], headers={"Referer": BASE_URL}) data = util.substr(page, '<label for="frmfilterSelectForm-filter">', "</select>") xbmcutil.add_dir( __language__(30007), params, info["img"], infoLabels=xbmc_info, menuItems={__language__(30007): "Action(info)"} ) add_addon_search(30006, "plugin.video.online-files", info, "search") def_trailer = None for m in re.finditer('<option value="(?P<url>[^"]+)[^>]+>(?P<name>[^<]+)', data, re.DOTALL | re.IGNORECASE): url = info["url"] + "/videa/-filtr-" + m.group("url") trailer = util._create_plugin_url({"play": url}) if def_trailer == None: info["trailer"] = trailer scrapper.set_info(info) xbmc_info["Title"] = "%s - %s" % (info["title"], m.group("name")) xbmcutil.add_video( m.group("name"), {"play": url}, info["img"], infoLabels=xbmc_info, menuItems={__language__(30007): "Action(info)"}, ) xbmcplugin.endOfDirectory(int(sys.argv[1]))
def preload_items(results): step = 100.0 / len(results) prog = 0 pDialog = xbmcgui.DialogProgress() progress = pDialog.create(__language__(30019)) pDialog.update(prog, __language__(30019)) for url, name in results: if pDialog.iscanceled(): pDialog.close() return prog = float(prog + step) pDialog.update(int(prog), __language__(30019), name) if not scrapper.get_cached_info(furl(url)): scrapper.get_info(furl(url)) time.sleep(3) pDialog.close()
def search_plugin(plugin, url, action): info = scrapper.get_info(url) titles = info["search-title"] params = {} if __addon__.getSetting("search-integration-update-history") == "false": params["search-no-history"] = "" for title in info["search-title"]: params[action] = title add_plugin_call(__language__(30008) + ": " + title, plugin, params, util.icon("search.png")) xbmcplugin.endOfDirectory(int(sys.argv[1]))
def index(): if request.method == "POST": data = request.form['search'] print(data) #parser info = scrapper.get_info(data) print(info) if(info == 1): return render_template('index.html',error=1) else: return render_template('index.html',info=info) return render_template('index.html')
def person(params): info = scrapper.get_info(params["person"]) xbmc_info = scrapper.xbmc_info(info) page = util.request(info["url"], headers={"Referer": BASE_URL}) data = util.substr(page, '<div id="filmography"', '<div id="fanclub"') results = [] for m in re.finditer("<td(?P<item>.+?)</td>", data, re.DOTALL | re.IGNORECASE): base = re.search('<a href="(?P<url>[^"]+)[^>]+>(?P<name>[^<]+)', m.group("item")) if base: name = base.group("name") for n in re.finditer("<span[^>]*>(?P<data>[^<]+)", m.group("item")): name = "%s %s" % (name, n.group("data")) results.append((base.group("url"), name)) if preload(): return preload_items(results) add_items(results) xbmcplugin.endOfDirectory(int(sys.argv[1]))