.*?rel="nofollow">(.*?)<\/a><\/li><\/ul><\/td><\/tr>| ')
- except:
- checktorrent = ""
- ###Busqueda Torrent si los encuentra sueltos
- if checktorrent == "Descargar .torrent":
- torrent_bloque = scrapertools.get_match(data,
- 'id="file".*?id="magnet".*?.*?')
-
- patron = '([^<]+)- (\d)(\d+)([^<]+).*?'
- patron += 'id="file".*?href="([^"]+)"'
- matches = re.compile(patron, re.DOTALL).findall(torrent_bloque)
- if len(matches) == 0:
- patron = '(.*?)(\d)(\d+)([^<]+) | .*?'
- patron += 'id="([^"]+)".*?href="([^"]+)"'
- matches = re.compile(patron, re.DOTALL).findall(bloque_capitulos)
- if len(matches) == 0:
- show = item.show
- extra = item.thumbnail
- category = item.category + "|" + "series"
-
- itemlist.append(Item(channel=item.channel,
- title="[COLOR gold][B]Ooops!! Algo no va bien,pulsa para ser dirigido a otra busqueda, ...[/B][/COLOR]",
- action="findvideos_peli", url=item.url,
- thumbnail="http://s6.postimg.org/fay99h9ox/briconoisethumb.png",
- fanart="http://s6.postimg.org/uie8tu1jl/briconoisefan.jpg", extra=extra,
- show=show, category=category, plot=item.plot, folder=True))
-
- import base64
-
- for title_links, seasson, epi, calidad, url_torrent in matches:
- ## torrent
- try:
- season = scrapertools.get_match(data, '.*?Temporada.*?(\d+).*?Torrent')
- except:
- ###Busqueda de season el las series que no vienen bien tipificadas como tal
- season = scrapertools.get_match(data, '.*?-.*?(\d+)x')
- epi = re.sub(r"101|201|301|401|501|601|701|801|901", "01", epi)
- epi = re.sub(r"102|202|302|402|502|602|702|802|902", "02", epi)
- epi = re.sub(r"103|203|303|403|503|603|703|803|903", "03", epi)
- epi = re.sub(r"104|204|304|404|504|604|704|804|904", "04", epi)
- epi = re.sub(r"105|205|305|405|505|605|705|805|905", "05", epi)
- epi = re.sub(r"106|206|306|406|506|606|706|806|906", "06", epi)
- epi = re.sub(r"107|207|307|407|507|607|707|807|907", "07", epi)
- epi = re.sub(r"108|208|308|408|508|608|708|808|908", "08", epi)
- epi = re.sub(r"109|209|309|409|509|609|709|809|909", "09", epi)
- epi = re.sub(r"110|210|310|410|510|610|710|810|910", "10", epi)
- epi = re.sub(r"111|211|311|411|511|611|711|811|911", "11", epi)
- epi = re.sub(r"112|212|312|412|512|612|712|812|912", "12", epi)
- epi = re.sub(r"113|213|313|413|513|613|713|813|913", "13", epi)
- epi = re.sub(r"114|214|314|414|514|614|714|814|914", "14", epi)
- epi = re.sub(r"115|215|315|415|515|615|715|815|915", "15", epi)
- epi = re.sub(r"116|216|316|416|516|616|716|816|916", "16", epi)
- epi = re.sub(r"117|217|317|417|517|617|717|817|917", "17", epi)
- epi = re.sub(r"118|218|318|418|518|618|718|818|918", "18", epi)
- epi = re.sub(r"119|219|319|419|519|619|719|819|919", "19", epi)
- epi = re.sub(r"120|220|320|420|520|620|720|820|920", "20", epi)
- epi = re.sub(r"121|221|321|421|521|621|721|821|921", "21", epi)
- epi = re.sub(r"122|222|322|422|522|622|722|822|922", "22", epi)
- epi = re.sub(r"123|223|323|423|523|623|723|823|923", "23", epi)
- epi = re.sub(r"124|224|324|424|524|624|724|824|924", "24", epi)
- epi = re.sub(r"125|225|325|425|525|625|725|825|925", "25", epi)
- epi = re.sub(r"126|226|326|426|526|626|726|826|926", "26", epi)
- epi = re.sub(r"127|227|327|427|527|627|727|827|927", "27", epi)
- epi = re.sub(r"128|228|328|428|528|628|728|828|928", "28", epi)
- epi = re.sub(r"129|229|329|429|529|629|729|829|929", "29", epi)
- epi = re.sub(r"130|230|330|430|530|630|730|830|930", "30", epi)
- seasson_epi = season + "x" + epi
- seasson_epi = seasson_epi.replace(seasson_epi, "[COLOR sandybrown]" + seasson_epi + "[/COLOR]")
- if "x0" in seasson_epi:
- epi = epi.replace("0", "")
- title_torrent = "[torrent]"
- title_torrent = title_torrent.replace(title_torrent, "[COLOR green]" + title_torrent + "[/COLOR]")
- calidad = calidad.replace(calidad, "[COLOR sandybrown]" + calidad + "[/COLOR]")
- title_links = title_links.replace(title_links, "[COLOR orange]" + title_links + "[/COLOR]")
- title_torrent = title_links + " " + seasson_epi + calidad + "- " + title_torrent
- url_torrent = base64.decodestring(url_torrent.split('&u=')[1][::-1])
- title_links = re.sub(r"\n|\r|\t|\s{2}|\(.*?\)|\[.*?\]| |REPARADO", "", title_links)
- title_links = title_links.replace('\[.*?\]', '')
- title_links = title_links.replace('á', 'a')
- title_links = title_links.replace('Á', 'A')
- title_links = title_links.replace('é', 'e')
- title_links = title_links.replace('í', 'i')
- title_links = title_links.replace('ó', 'o')
- title_links = title_links.replace('ú', 'u')
- title_links = title_links.replace(' ', '%20')
- extra = season + "|" + title_links + "|" + epi
- itemlist.append(Item(channel=item.channel, title=title_torrent, action="episodios", url=url_torrent,
- thumbnail=item.extra, fanart=item.show, extra=extra, plot=item.plot,
- category=item.category, folder=True))
- else:
- ###Busqueda cuando hay Torrent pero no magnet en la serie
- if 'id="file"' in data and not 'id="magnet"' in data:
-
- patron = '([^<]+)- (\d)(\d+)([^<]+).*?'
- patron += 'id="([^"]+)".*?href="([^"]+)"'
- matches = re.compile(patron, re.DOTALL).findall(data)
- if len(matches) == 0:
- patron = '(.*?)(\d)(\d+)([^<]+).*?'
- patron += 'id="([^"]+)".*?href="([^"]+)"'
- matches = re.compile(patron, re.DOTALL).findall(bloque_capitulos)
- if len(matches) == 0:
- show = item.show
- extra = item.thumbnail
- category = item.category + "|" + "series"
- itemlist.append(Item(channel=item.channel,
- title="[COLOR gold][B]Ooops!! Algo no va bien,pulsa para ser dirigido a otra busqueda, ...[/B][/COLOR]",
- action="findvideos_peli", url=item.url,
- thumbnail="http://s6.postimg.org/fay99h9ox/briconoisethumb.png",
- fanart="http://s6.postimg.org/uie8tu1jl/briconoisefan.jpg", extra=extra,
- show=show, category=category, plot=item.plot, folder=True))
- import base64
- for title_links, seasson, epi, calidad, title_torrent, url_torrent in matches:
- try:
- season = scrapertools.get_match(data, '.*?Temporada.*?(\d+).*?Torrent')
- except:
- ###Busqueda de season el las series que no vienen bien tipificadas como tal
- season = scrapertools.get_match(data, '.*?-.*?(\d+)x')
- epi = re.sub(r"101|201|301|401|501|601|701|801|901", "01", epi)
- epi = re.sub(r"102|202|302|402|502|602|702|802|902", "02", epi)
- epi = re.sub(r"103|203|303|403|503|603|703|803|903", "03", epi)
- epi = re.sub(r"104|204|304|404|504|604|704|804|904", "04", epi)
- epi = re.sub(r"105|205|305|405|505|605|705|805|905", "05", epi)
- epi = re.sub(r"106|206|306|406|506|606|706|806|906", "06", epi)
- epi = re.sub(r"107|207|307|407|507|607|707|807|907", "07", epi)
- epi = re.sub(r"108|208|308|408|508|608|708|808|908", "08", epi)
- epi = re.sub(r"109|209|309|409|509|609|709|809|909", "09", epi)
- epi = re.sub(r"110|210|310|410|510|610|710|810|910", "10", epi)
- epi = re.sub(r"111|211|311|411|511|611|711|811|911", "11", epi)
- epi = re.sub(r"112|212|312|412|512|612|712|812|912", "12", epi)
- epi = re.sub(r"113|213|313|413|513|613|713|813|913", "13", epi)
- epi = re.sub(r"114|214|314|414|514|614|714|814|914", "14", epi)
- epi = re.sub(r"115|215|315|415|515|615|715|815|915", "15", epi)
- epi = re.sub(r"116|216|316|416|516|616|716|816|916", "16", epi)
- epi = re.sub(r"117|217|317|417|517|617|717|817|917", "17", epi)
- epi = re.sub(r"118|218|318|418|518|618|718|818|918", "18", epi)
- epi = re.sub(r"119|219|319|419|519|619|719|819|919", "19", epi)
- epi = re.sub(r"120|220|320|420|520|620|720|820|920", "20", epi)
- epi = re.sub(r"121|221|321|421|521|621|721|821|921", "21", epi)
- epi = re.sub(r"122|222|322|422|522|622|722|822|922", "22", epi)
- epi = re.sub(r"123|223|323|423|523|623|723|823|923", "23", epi)
- epi = re.sub(r"124|224|324|424|524|624|724|824|924", "24", epi)
- epi = re.sub(r"125|225|325|425|525|625|725|825|925", "25", epi)
- epi = re.sub(r"126|226|326|426|526|626|726|826|926", "26", epi)
- epi = re.sub(r"127|227|327|427|527|627|727|827|927", "27", epi)
- epi = re.sub(r"128|228|328|428|528|628|728|828|928", "28", epi)
- epi = re.sub(r"129|229|329|429|529|629|729|829|929", "29", epi)
- epi = re.sub(r"130|230|330|430|530|630|730|830|930", "30", epi)
-
- seasson_epi = season + "x" + epi
- seasson_epi = seasson_epi.replace(seasson_epi, "[COLOR sandybrown]" + seasson_epi + "[/COLOR]")
- if "x0" in seasson_epi:
- epi = epi.replace("0", "")
- title_torrent = "[" + title_torrent.replace("file", "torrent") + "]"
- title_torrent = title_torrent.replace(title_torrent, "[COLOR green]" + title_torrent + "[/COLOR]")
- calidad = calidad.replace(calidad, "[COLOR sandybrown]" + calidad + "[/COLOR]")
- title_links = title_links.replace(title_links, "[COLOR orange]" + title_links + "[/COLOR]")
- title_torrent = title_links + " " + seasson_epi + calidad + "- " + title_torrent
- url_torrent = base64.decodestring(url_torrent.split('&u=')[1][::-1])
- title_links = re.sub(r"\n|\r|\t|\s{2}|\(.*?\)|\[.*?\]| |REPARADO", "", title_links)
- title_links = title_links.replace('\[.*?\]', '')
- title_links = title_links.replace('á', 'a')
- title_links = title_links.replace('Á', 'A')
- title_links = title_links.replace('é', 'e')
- title_links = title_links.replace('í', 'i')
- title_links = title_links.replace('ó', 'o')
- title_links = title_links.replace('ú', 'u')
- title_links = title_links.replace(' ', '%20')
- extra = season + "|" + title_links + "|" + epi
- itemlist.append(Item(channel=item.channel, title=title_torrent, action="episodios", url=url_torrent,
- thumbnail=item.extra, fanart=item.show, extra=extra, plot=item.plot,
- category=item.category, folder=True))
- ###Busqueda cuando hay Magnet pero no Torrent
- if 'id="magnet"' in data and not 'id="file"' in data:
- patron = '([^<]+)- (\d)(\d+)([^<]+).*?'
- patron += 'id="([^"]+)" href="([^"]+)"'
- matches = re.compile(patron, re.DOTALL).findall(data)
- if len(matches) == 0:
- patron = '(.*?)(\d)(\d+)([^<]+).*?'
- patron += 'id="([^"]+)".*?href="([^"]+)"'
- matches = re.compile(patron, re.DOTALL).findall(bloque_capitulos)
- if len(matches) == 0:
- show = item.show
- extra = item.extra
- itemlist.append(Item(channel=item.channel,
- title="[COLOR gold][B]Ooops!! Algo no va bien,pulsa para ser dirigido a otra busqueda, ...[/B][/COLOR]",
- action="findvideos_peli", url=item.url,
- thumbnail="http://s6.postimg.org/fay99h9ox/briconoisethumb.png",
- fanart="http://s6.postimg.org/uie8tu1jl/briconoisefan.jpg", extra=extra, show=show,
- folder=True))
- import base64
- for title_links, seasson, epi, calidad, title_magnet, url_magnet in matches:
- try:
- season = scrapertools.get_match(data, '.*?Temporada.*?(\d+).*?Torrent')
- except:
- ###Busqueda de season el las series que no vienen bien tipificadas como tal
- season = scrapertools.get_match(data, '.*?-.*?(\d+)x')
- epi = re.sub(r"101|201|301|401|501|601|701|801|901", "01", epi)
- epi = re.sub(r"102|202|302|402|502|602|702|802|902", "02", epi)
- epi = re.sub(r"103|203|303|403|503|603|703|803|903", "03", epi)
- epi = re.sub(r"104|204|304|404|504|604|704|804|904", "04", epi)
- epi = re.sub(r"105|205|305|405|505|605|705|805|905", "05", epi)
- epi = re.sub(r"106|206|306|406|506|606|706|806|906", "06", epi)
- epi = re.sub(r"107|207|307|407|507|607|707|807|907", "07", epi)
- epi = re.sub(r"108|208|308|408|508|608|708|808|908", "08", epi)
- epi = re.sub(r"109|209|309|409|509|609|709|809|909", "09", epi)
- epi = re.sub(r"110|210|310|410|510|610|710|810|910", "10", epi)
- epi = re.sub(r"111|211|311|411|511|611|711|811|911", "11", epi)
- epi = re.sub(r"112|212|312|412|512|612|712|812|912", "12", epi)
- epi = re.sub(r"113|213|313|413|513|613|713|813|913", "13", epi)
- epi = re.sub(r"114|214|314|414|514|614|714|814|914", "14", epi)
- epi = re.sub(r"115|215|315|415|515|615|715|815|915", "15", epi)
- epi = re.sub(r"116|216|316|416|516|616|716|816|916", "16", epi)
- epi = re.sub(r"117|217|317|417|517|617|717|817|917", "17", epi)
- epi = re.sub(r"118|218|318|418|518|618|718|818|918", "18", epi)
- epi = re.sub(r"119|219|319|419|519|619|719|819|919", "19", epi)
- epi = re.sub(r"120|220|320|420|520|620|720|820|920", "20", epi)
- epi = re.sub(r"121|221|321|421|521|621|721|821|921", "21", epi)
- epi = re.sub(r"122|222|322|422|522|622|722|822|922", "22", epi)
- epi = re.sub(r"123|223|323|423|523|623|723|823|923", "23", epi)
- epi = re.sub(r"124|224|324|424|524|624|724|824|924", "24", epi)
- epi = re.sub(r"125|225|325|425|525|625|725|825|925", "25", epi)
- epi = re.sub(r"126|226|326|426|526|626|726|826|926", "26", epi)
- epi = re.sub(r"127|227|327|427|527|627|727|827|927", "27", epi)
- epi = re.sub(r"128|228|328|428|528|628|728|828|928", "28", epi)
- epi = re.sub(r"129|229|329|429|529|629|729|829|929", "29", epi)
- epi = re.sub(r"130|230|330|430|530|630|730|830|930", "30", epi)
-
- seasson_epi = season + "x" + epi
- seasson_epi = seasson_epi.replace(seasson_epi, "[COLOR sandybrown]" + seasson_epi + "[/COLOR]")
- if "x0" in seasson_epi:
- epi = epi.replace("0", "")
- title_magnet = "[" + "magnet" + "]"
- title_magnet = "[COLOR red]Opción[/COLOR]" + " " + title_magnet.replace(title_magnet,
- "[COLOR crimson]" + title_magnet + "[/COLOR]")
- calidad = calidad.replace(calidad, "[COLOR sandybrown]" + calidad + "[/COLOR]")
- title_links = title_links.replace(title_links, "[COLOR orange]" + title_links + "[/COLOR]")
- title_magnet = title_links + " " + seasson_epi + calidad + "- " + title_magnet
- url_magnet = base64.decodestring(url_magnet.split('&u=')[1][::-1])
- title_links = re.sub(r"\n|\r|\t|\s{2}|\(.*?\)|\[.*?\]| |REPARADO", "", title_links)
- title_links = title_links.replace('\[.*?\]', '')
- title_links = title_links.replace('á', 'a')
- title_links = title_links.replace('Á', 'A')
- title_links = title_links.replace('é', 'e')
- title_links = title_links.replace('í', 'i')
- title_links = title_links.replace('ó', 'o')
- title_links = title_links.replace('ú', 'u')
- title_links = title_links.replace(' ', '%20')
- extra = season + "|" + title_links + "|" + epi
- itemlist.append(
- Item(channel=item.channel, title=title_magnet, action="episodios", url=url_magnet, thumbnail=item.extra,
- fanart=item.show, extra=extra, plot=item.plot, category=item.category, folder=True))
- ###No hay video
- if not 'id="file"' in data and not 'id="magnet"' in data:
- show = item.show
- extra = item.extra
- itemlist.append(Item(channel=item.channel,
- title="[COLOR gold][B]Ooops!! Algo no va bien,pulsa para ser dirigido a otra busqueda, ...[/B][/COLOR]",
- action="findvideos_peli", url=item.url,
- thumbnail="http://s6.postimg.org/fay99h9ox/briconoisethumb.png",
- fanart="http://s6.postimg.org/uie8tu1jl/briconoisefan.jpg", extra=extra, show=show,
- folder=True))
-
- return itemlist
-
-
-def episodios(item):
- logger.info()
- itemlist = []
- ###Borra Customkey si no hay música
- import xbmc
- TESTPYDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "test.py")
- if not xbmc.Player().isPlaying() and os.path.exists(TESTPYDESTFILE):
- TESTPYDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "test.py")
- KEYMAPDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "customkey.xml")
- REMOTEDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "remote.xml")
- APPCOMMANDDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "customapp.xml")
- try:
- os.remove(KEYMAPDESTFILE)
- print "Custom Keyboard.xml borrado"
- os.remove(TESTPYDESTFILE)
- print "Testpy borrado"
- os.remove(REMOTEDESTFILE)
- print "Remote borrado"
- os.remove(APPCOMMANDDESTFILE)
- print "Appcommand borrado"
- xbmc.executebuiltin('Action(reloadkeymaps)')
- except Exception as inst:
- xbmc.executebuiltin('Action(reloadkeymaps)')
- print "No hay customs"
-
- season = item.extra.split("|")[0]
- title_links = item.extra.split("|")[1]
- epi = item.extra.split("|")[2]
- title_tag = "[COLOR yellow]Ver --[/COLOR]"
- item.title = item.title.replace("Ver --", "")
- if "magnet" in item.title:
- title_links = title_links.replace("%20", "")
- title_links = "[COLOR orange]" + title_links + " " + season + "x" + epi + "[/COLOR]"
- title = title_tag + title_links + " " + item.title
- else:
- item.title = re.sub(r"\[.*?\]", "", item.title)
- title = title_tag + "[COLOR orange]" + item.title + "[/COLOR]" + "[COLOR green][torrent][/COLOR]"
-
- if item.plot == "Sensación de vivir: La nueva generación":
- item.plot = "90210"
- if item.plot == "La historia del universo":
- item.plot = "how the universe works"
- try:
- # Nueva busqueda bing de Imdb serie id
- url_imdb = "http://www.bing.com/search?q=%s+tv+series+site:imdb.com" % item.plot.replace(' ', '+')
- data = browser(url_imdb)
-
- data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
- try:
- subdata_imdb = scrapertools.get_match(data, '(.*?)h="ID')
- except:
- pass
- try:
- imdb_id = scrapertools.get_match(subdata_imdb, '.*?Temporada.*?(\d+).*?Torrent')
- except:
- season = "1"
- title_link = scrapertools.get_match(title_links, '(.*?) -')
- epi = scrapertools.get_match(title_links, '-.*?(x\d+)')
- if "x0" in epi:
- epi = epi.replace("x0", "")
- title_links = title_link
- action = "episodios"
- extra = season + "|" + title_links + "|" + epi
- itemlist.append(Item(channel=item.channel, title=title_torrent, action=action, url=url_torrent,
- server="torrent", thumbnail=item.extra, fanart=item.show, extra=extra,
- category=item.category, plot=item.plot, folder=True))
- itemlist.append(
- Item(channel=item.channel, title=title_magnet, action=action, url=url_magnet, server="torrent",
- thumbnail=item.extra, category=item.category, fanart=item.show, extra=extra,
- plot=item.plot, folder=True))
- else:
- action = "play"
- itemlist.append(Item(channel=item.channel, title=title_torrent, action=action, url=url_torrent,
- server="torrent", thumbnail=item.extra, fanart=item.show, folder=False))
- itemlist.append(
- Item(channel=item.channel, title=title_magnet, action=action, url=url_magnet, server="torrent",
- thumbnail=item.extra, fanart=item.show, folder=False))
- else:
- ###Busca video cuando hay torrent pero no magnet
- if 'id="file"' in data and not 'id="magnet"' in data:
- patron = '([^"]+).*?'
- patron += 'id="([^"]+)".*?href="([^"]+)".*?'
-
- matches = re.compile(patron, re.DOTALL).findall(data)
- if len(matches) == 0:
- itemlist.append(Item(channel=item.channel,
- title="[COLOR gold][B]El video ya no se encuentra en la web, prueba a encontrala por busqueda...[/B][/COLOR]",
- thumbnail="http://s6.postimg.org/fay99h9ox/briconoisethumb.png",
- fanart="http://s6.postimg.org/uie8tu1jl/briconoisefan.jpg", folder=False))
- import base64
- for title_links, title_torrent, url_torrent in matches:
- ## torrent
- title_torrent = "[" + title_torrent.replace("file", "torrent") + "]"
- title_torrent = title_torrent.replace(title_torrent, "[COLOR green]" + title_torrent + "[/COLOR]")
- title_links = title_links.replace(title_links, "[COLOR sandybrown]" + title_links + "[/COLOR]")
- title_links = re.sub(r".*?;", "", title_links)
- title_tag = "[COLOR yellow]Ver --[/COLOR]"
- title_torrent = title_tag + title_links + "- " + title_torrent
- url_torrent = base64.decodestring(url_torrent.split('&u=')[1][::-1])
- if "sinopsis.png" in item.extra:
- item.extra = "http://oi67.tinypic.com/28sxwrs.jpg"
- ###Se identifica si es una serie mal tipificada
- if "series" in item.category and not "Completa" in title_links:
- try:
- season = scrapertools.get_match(data, '.*?Temporada.*?(\d+).*?Torrent')
- except:
- season = "1"
- title_link = scrapertools.get_match(title_links, '(.*?) -')
- epi = scrapertools.get_match(title_links, '-.*?(x\d+)')
- if "x0" in epi:
- epi = epi.replace("x0", "")
- title_links = title_link
- action = "episodios"
- extra = season + "|" + title_links + "|" + epi
- itemlist.append(Item(channel=item.channel, title=title_torrent, action=action, url=url_torrent,
- server="torrent", thumbnail=item.extra, fanart=item.show, extra=extra,
- category=item.category, plot=item.plot, folder=True))
-
- else:
- action = "play"
- itemlist.append(Item(channel=item.channel, title=title_torrent, action=action, url=url_torrent,
- server="torrent", thumbnail=item.extra, fanart=item.show, folder=False))
- ###Busca video cuando solo hay magnet y no torrent
- if 'id="magnet"' in data and not 'id="file"' in data:
- patron = '([^"]+).*?'
- patron += 'id="([^"]+)" href="([^"]+)"'
-
- matches = re.compile(patron, re.DOTALL).findall(data)
- if len(matches) == 0:
- itemlist.append(Item(channel=item.channel,
- title="[COLOR gold][B]El video ya no se encuentra en la web, prueba a encontrala por busqueda...[/B][/COLOR]",
- thumbnail="http://s6.postimg.org/fay99h9ox/briconoisethumb.png",
- fanart="http://s6.postimg.org/uie8tu1jl/briconoisefan.jpg", folder=False))
- import base64
- for title_links, title_magnet, url_magnet in matches:
- title_magnet = "[" + "magnet" + "]"
- title_links = title_links.replace(title_links, "[COLOR sandybrown]" + title_links + "[/COLOR]")
- title_links = re.sub(r".*?;", "", title_links)
- title_tag = "[COLOR red]Ver --[/COLOR]"
- title_magnet = title_tag + title_links + "- " + title_magnet.replace(title_magnet,
- "[COLOR crimson]" + title_magnet + "[/COLOR]")
- url_magnet = base64.decodestring(url_magnet.split('&u=')[1][::-1])
- if "sinopsis.png" in item.extra:
- item.extra = "http://oi67.tinypic.com/28sxwrs.jpg"
- ###Se identifica si es una serie mal tipificada
- if "series" in item.category and not "Completa" in title_links:
- try:
- season = scrapertools.get_match(data, '.*?Temporada.*?(\d+).*?Torrent')
- except:
- season = "1"
- title_link = scrapertools.get_match(title_links, '(.*?) -')
- epi = scrapertools.get_match(title_links, '-.*?(x\d+)')
- if "x0" in epi:
- epi = epi.replace("x0", "")
- title_links = title_link
- action = "episodios"
- extra = season + "|" + title_links + "|" + epi
- itemlist.append(Item(channel=item.channel, title=title_torrent, action=action, url=url_torrent,
- server="torrent", thumbnail=item.extra, fanart=item.show, extra=extra,
- category=item.category, plot=item.plot, folder=True))
-
- else:
- action = "play"
-
- itemlist.append(
- Item(channel=item.channel, title=title_magnet, action=action, url=url_magnet, server="torrent",
- thumbnail=item.extra, fanart=item.show, folder=False))
- ###No hay torrent ni magnet
- if not 'id="file"' in data and not 'id="magnet"' in data:
- itemlist.append(Item(channel=item.channel,
- title="[COLOR gold][B]El video ya no se encuentra en la web, prueba a encontrala por busqueda...[/B][/COLOR]",
- thumbnail="http://s6.postimg.org/fay99h9ox/briconoisethumb.png",
- fanart="http://s6.postimg.org/uie8tu1jl/briconoisefan.jpg", folder=False))
- return itemlist
-
-
-def trailer(item):
- logger.info()
- ###Crea archivo control trailer.txt para evitar la recarga de la música cuando se vuelve de trailer
- import xbmc
- TESTPYDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "test.py")
- if os.path.exists(TESTPYDESTFILE):
- TRAILERDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "trailer.txt")
-
- urllib.urlretrieve("https://raw.githubusercontent.com/neno1978/script.palc.forcerefresh/master/trailer.txt",
- TRAILERDESTFILE)
-
- itemlist = []
- data = get_page(item.url)
-
- # trailer
- patron = "|||itemprop=".*?"|y otros.*?&',
- '', info)
- info = info.replace("", ":")
- info = info.replace("", ":")
- info = info.replace(" ", ":")
- info = info.replace("", " ")
- info = info.replace("", " ")
-
- info = info.replace("Actores:", "[COLOR red][B]Actores:[/B][/COLOR] ")
- photo = item.extra
- foto = item.category
- quit = "Pulsa" + " [COLOR crimson][B]INTRO [/B][/COLOR]" + "para quitar"
- ###Se carga Customkey no atras
- NOBACKDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "noback.xml")
- REMOTENOBACKDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "remotenoback.xml")
- APPNOBACKDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "appnoback.xml")
- urllib.urlretrieve("https://raw.githubusercontent.com/neno1978/script.palc.forcerefresh/master/noback.xml",
- NOBACKDESTFILE)
- urllib.urlretrieve(
- "https://raw.githubusercontent.com/neno1978/script.palc.forcerefresh/master/Bricocine/remotenoback.xml",
- REMOTENOBACKDESTFILE)
- urllib.urlretrieve(
- "https://raw.githubusercontent.com/neno1978/script.palc.forcerefresh/master/appnoback.xml",
- APPNOBACKDESTFILE)
- xbmc.executebuiltin('Action(reloadkeymaps)')
- else:
- data = get_page(item.url)
- data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
- patron = '.*?([^<]+).*? .*?'
- patron += '([^"]+)'
- matches = re.compile(patron, re.DOTALL).findall(data)
-
- if len(matches) == 0:
- title = "[COLOR red][B]LO SENTIMOS...[/B][/COLOR]"
- plot = "Esta pelicula no tiene sinopsis..."
- plot = plot.replace(plot, "[COLOR yellow][B]" + plot + "[/B][/COLOR]")
- foto = "http://s6.postimg.org/ub7pb76c1/noinfo.png"
- photo = "http://s6.postimg.org/nm3gk1xox/noinfosup2.png"
- info = ""
- quit = "Pulsa" + " [COLOR crimson][B]INTRO [/B][/COLOR]" + "para quitar"
-
- for plot, title in matches:
- title = title.upper()
- title = title.replace(title, "[COLOR sandybrown][B]" + title + "[/B][/COLOR]")
- title = re.sub(r".*?;|\[HD .*?\]|", "", title)
- plot_title = "Sinopsis" + "[CR]"
- plot_title = plot_title.replace(plot_title, "[COLOR red]" + plot_title + "[/COLOR]")
- plot = plot_title + plot
- plot = plot.replace(plot, "[COLOR white][B]" + plot + "[/B][/COLOR]")
- plot = plot.replace('div class="margin_20b">', '')
- plot = plot.replace('div class="post-entry">', '')
- try:
- scrapedinfo = scrapertools.get_match(data, 'Ficha técnica- (.*?)hellip')
- except IndexError:
- scrapedinfo = scrapertools.get_match(data,
- 'Ficha técnica
- (.*?)", " ")
- scrapedinfo = scrapedinfo.replace("
", "- ")
- scrpaedinfo = re.sub(r').*?
- ', re.DOTALL).findall(scrapedinfo)
- for info in infoformat:
- scrapedinfo = scrapedinfo.replace(scrapedinfo, "[COLOR white][B]" + scrapedinfo + "[/COLOR]")
- scrapedinfo = scrapedinfo.replace(info, "[COLOR red][B]" + info + "[/B][/COLOR]")
- info = scrapedinfo
- info = re.sub(
- r'|title=".*?">||
|||itemprop=".*?"|y otros.*?&',
- '', info)
- info = info.replace("", ":")
- info = info.replace("", ":")
- info = info.replace(" ", ":")
- info = info.replace("", " ")
- info = info.replace("", " ")
- if "hellip" in data:
- info = info.replace("Actores:", "[COLOR red][B]Actores:[/B][/COLOR] ")
-
- foto = item.category
- photo = item.extra
- quit = "Pulsa" + " [COLOR crimson][B]INTRO [/B][/COLOR]" + "para quitar"
-
- ventana2 = TextBox1(title=title, plot=plot, info=info, thumbnail=photo, fanart=foto, quit=quit)
- ventana2.doModal()
-
-
-ACTION_GESTURE_SWIPE_LEFT = 511
-ACTION_SELECT_ITEM = 7
-
-
-class TextBox1(xbmcgui.WindowDialog):
- """ Create a skinned textbox window """
-
- def __init__(self, *args, **kwargs):
-
- self.getTitle = kwargs.get('title')
- self.getPlot = kwargs.get('plot')
- self.getInfo = kwargs.get('info')
- self.getThumbnail = kwargs.get('thumbnail')
- self.getFanart = kwargs.get('fanart')
- self.getQuit = kwargs.get('quit')
-
- self.background = xbmcgui.ControlImage(70, 20, 1150, 630,
- 'http://s6.postimg.org/58jknrvtd/backgroundventana5.png')
- self.title = xbmcgui.ControlTextBox(140, 60, 1130, 50)
- self.quit = xbmcgui.ControlTextBox(145, 90, 1030, 45)
- self.plot = xbmcgui.ControlTextBox(120, 150, 1056, 140)
- self.info = xbmcgui.ControlFadeLabel(120, 310, 1056, 100)
- self.thumbnail = xbmcgui.ControlImage(813, 43, 390, 100, self.getThumbnail)
- self.fanart = xbmcgui.ControlImage(120, 365, 1060, 250, self.getFanart)
-
- self.addControl(self.background)
- self.addControl(self.title)
- self.addControl(self.quit)
- self.addControl(self.plot)
- self.addControl(self.thumbnail)
- self.addControl(self.fanart)
- self.addControl(self.info)
-
- self.title.setText(self.getTitle)
- self.quit.setText(self.getQuit)
- try:
- self.plot.autoScroll(7000, 6000, 30000)
- except:
- ###Información de incompatibilidd autoscroll con versiones inferiores a isengrd
- print "Actualice a la ultima version de kodi para mejor info"
- import xbmc
- xbmc.executebuiltin(
- 'Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000,"https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kodi-icon.png")')
- self.plot.setText(self.getPlot)
- self.info.addLabel(self.getInfo)
-
- def get(self):
-
- self.show()
-
- def onAction(self, action):
- if action == ACTION_SELECT_ITEM or action == ACTION_GESTURE_SWIPE_LEFT:
- ###Se vuelven a cargar Customkey al salir de info
- import os, sys
- import xbmc
- APPCOMMANDDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "customapp.xml")
- NOBACKDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "noback.xml")
- REMOTENOBACKDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "remotenoback.xml")
- APPNOBACKDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "appnoback.xml")
- TESTPYDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "test.py")
- try:
- os.remove(NOBACKDESTFILE)
- os.remove(REMOTENOBACKDESTFILE)
- os.remove(APPNOBACKDESTFILE)
- if os.path.exists(TESTPYDESTFILE):
- urllib.urlretrieve(
- "https://raw.githubusercontent.com/neno1978/script.palc.forcerefresh/master/Bricocine/customapp.xml",
- APPCOMMANDDESTFILE)
- xbmc.executebuiltin('Action(reloadkeymaps)')
- except:
- pass
- self.close()
-
-
-def info_capitulos(item):
- logger.info()
- import xbmc
- APPCOMMANDDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "customapp.xml")
- try:
- os.remove(APPCOMMANDDESTFILE)
- except:
- pass
- url = item.url
- data = scrapertools.cache_page(url)
- data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
- if "series" in item.category:
- item.category = item.category.split("|")[0]
- else:
- item.category = item.show.split("|")[0]
- item.thumbnail = item.show.split("|")[1]
- capitulo = item.extra.split("|")[2]
- capitulo = re.sub(r"(0)\d;", "", capitulo)
- url = "http://thetvdb.com/api/1D62F2F90030C444/series/" + item.show.split("|")[0] + "/default/" + \
- item.extra.split("|")[0] + "/" + capitulo + "/es.xml"
- data = scrapertools.cache_page(url)
- data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
- patron = '.*?([^<]+).*?'
- patron += '(.*?).*?'
-
- matches = re.compile(patron, re.DOTALL).findall(data)
- if len(matches) == 0:
- title = "[COLOR red][B]LO SENTIMOS...[/B][/COLOR]"
- plot = "Este capitulo no tiene informacion..."
- plot = plot.replace(plot, "[COLOR yellow][B]" + plot + "[/B][/COLOR]")
- image = "http://s6.postimg.org/ub7pb76c1/noinfo.png"
- foto = "http://s6.postimg.org/nm3gk1xox/noinfosup2.png"
- quit = "Pulsa" + " [COLOR greenyellow][B]INTRO [/B][/COLOR]" + "para quitar"
- else:
-
- for name_epi, info in matches:
- if "episodes" in data:
- foto = scrapertools.get_match(data, '.*?(.*?)')
- fanart = "http://thetvdb.com/banners/" + foto
- else:
- fanart = item.show.split("|")[1]
- if item.show.split("|")[1] == item.thumbnail:
- fanart = "http://s6.postimg.org/4asrg755b/bricotvshows2.png"
-
- plot = info
- plot = (translate(plot, "es"))
- plot = plot.replace(plot, "[COLOR yellow][B]" + plot + "[/B][/COLOR]")
- name_epi = re.sub(r".*?;|&", "", name_epi)
- plot = re.sub(r".*?;", "", plot)
- title = name_epi.upper()
- title = title.replace(title, "[COLOR sandybrown][B]" + title + "[/B][/COLOR]")
- image = fanart
- foto = item.show.split("|")[1]
- if not ".png" in item.show.split("|")[1]:
- foto = "http://s6.postimg.org/6flcihb69/brico1sinopsis.png"
- quit = "Pulsa" + " [COLOR greenyellow][B]INTRO [/B][/COLOR]" + "para quitar"
- NOBACKDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "noback.xml")
- REMOTENOBACKDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "remotenoback.xml")
- APPNOBACKDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "appnoback.xml")
- TESTPYDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "test.py")
- urllib.urlretrieve("https://raw.githubusercontent.com/neno1978/script.palc.forcerefresh/master/noback.xml",
- NOBACKDESTFILE)
- urllib.urlretrieve(
- "https://raw.githubusercontent.com/neno1978/script.palc.forcerefresh/master/Bricocine/remotenoback.xml",
- REMOTENOBACKDESTFILE)
- urllib.urlretrieve(
- "https://raw.githubusercontent.com/neno1978/script.palc.forcerefresh/master/appnoback.xml",
- APPNOBACKDESTFILE)
- xbmc.executebuiltin('Action(reloadkeymaps)')
- ventana = TextBox2(title=title, plot=plot, thumbnail=image, fanart=foto, quit=quit)
- ventana.doModal()
-
-
-ACTION_GESTURE_SWIPE_LEFT = 511
-ACTION_SELECT_ITEM = 7
-
-
-class TextBox2(xbmcgui.WindowDialog):
- """ Create a skinned textbox window """
-
- def __init__(self, *args, **kwargs):
- self.getTitle = kwargs.get('title')
- self.getPlot = kwargs.get('plot')
- self.getThumbnail = kwargs.get('thumbnail')
- self.getFanart = kwargs.get('fanart')
- self.getQuit = kwargs.get('quit')
-
- self.background = xbmcgui.ControlImage(70, 20, 1150, 630, 'http://s6.postimg.org/n3ph1uxn5/ventana.png')
- self.title = xbmcgui.ControlTextBox(120, 60, 430, 50)
- self.quit = xbmcgui.ControlTextBox(145, 110, 1030, 45)
- self.plot = xbmcgui.ControlTextBox(120, 150, 1056, 100)
- self.thumbnail = xbmcgui.ControlImage(120, 300, 1056, 300, self.getThumbnail)
- self.fanart = xbmcgui.ControlImage(780, 43, 390, 100, self.getFanart)
-
- self.addControl(self.background)
- self.addControl(self.title)
- self.addControl(self.quit)
- self.addControl(self.plot)
- self.addControl(self.thumbnail)
- self.addControl(self.fanart)
-
- self.title.setText(self.getTitle)
- self.quit.setText(self.getQuit)
- try:
- self.plot.autoScroll(7000, 6000, 30000)
- except:
- print "Actualice a la ultima version de kodi para mejor info"
- import xbmc
- xbmc.executebuiltin(
- 'Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000,"https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kodi-icon.png")')
- self.plot.setText(self.getPlot)
-
- def get(self):
- self.show()
-
- def onAction(self, action):
- if action == ACTION_SELECT_ITEM or action == ACTION_GESTURE_SWIPE_LEFT:
- import os, sys
- import xbmc
- APPCOMMANDDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "customapp.xml")
- NOBACKDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "noback.xml")
- REMOTENOBACKDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "remotenoback.xml")
- APPNOBACKDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "appnoback.xml")
- TESTPYDESTFILE = os.path.join(xbmc.translatePath('special://userdata/keymaps'), "test.py")
- try:
- os.remove(NOBACKDESTFILE)
- os.remove(REMOTENOBACKDESTFILE)
- os.remove(APPNOBACKDESTFILE)
- xbmc.executebuiltin('Action(reloadkeymaps)')
- if os.path.exists(TESTPYDESTFILE):
- urllib.urlretrieve(
- "https://raw.githubusercontent.com/neno1978/script.palc.forcerefresh/master/Bricocine/customapp.xml",
- APPCOMMANDDESTFILE)
- xbmc.executebuiltin('Action(reloadkeymaps)')
- except:
- xbmc.executebuiltin('Action(reloadkeymaps)')
- self.close()
-
-
-def translate(to_translate, to_langage="auto", langage="auto"):
- ###Traducción atraves de Google
- '''Return the translation using google translate
- you must shortcut the langage you define (French = fr, English = en, Spanish = es, etc...)
- if you don't define anything it will detect it or use english by default
- Example:
- print(translate("salut tu vas bien?", "en"))
- hello you alright?'''
- agents = {
- 'User-Agent': "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)"}
- before_trans = 'class="t0">'
- link = "http://translate.google.com/m?hl=%s&sl=%s&q=%s" % (to_langage, langage, to_translate.replace(" ", "+"))
- request = urllib2.Request(link, headers=agents)
- page = urllib2.urlopen(request).read()
- result = page[page.find(before_trans) + len(before_trans):]
- result = result.split("<")[0]
- return result
-
-
-if __name__ == '__main__':
- to_translate = 'Hola como estas?'
- print("%s >> %s" % (to_translate, translate(to_translate)))
- print("%s >> %s" % (to_translate, translate(to_translate, 'fr')))
-# should print Hola como estas >> Hello how are you
-# and Hola como estas? >> Bonjour comment allez-vous?
|