honestly, I don't knowjurrabi escribió:Do you know any reason to keep the .*? ???
3 italian channel (PLEASE!)
Re: 3 italian channel (PLEASE!)
Mensaje por jurrabi » 27 Ago 2010, 01:16
The text is coded with utf-8 and using HTML Decimal Entities to represent some special characters (like n-dash coded like –).
I couln't find any standard library in 2.4 (the python vesrion inbebed in XBMC) but I found this small elegant procedure to change all HTML entities into the respective unicode chars (thanks Fredrik Lundh)
So, because the text is coded with utf-8, the procedure returns unicode and the plugin is coded with latin1 we have to do the following:
Convert (decode) the title to unicode so de unscapeprocedure will work and return a unicode string. then, we have to reencode but this time to latin1. Because we might find characters that where in the page (in utf-8 or HTML Entities-unicode) that are not Latin1 compatible, we have to be sure we don't generate an encodig error.
The final code:
Código: Seleccionar todo
UnicodeDecodedTitle = match[2].decode("utf-8")
unescapedTitle = unescape (UnicodeDecodedTitle)
scrapedtitle = unescapedTitle.encode("latin1","ignore")
First we need to change from latin1 (iso-8859-1) code page to utf-8. Then we need to start using xbmc strings to allow others to translate de plugin... and we need to modify al encode/decode operations to work fine with any code page... For now let it stay this way.
Publicidad
Re: 3 italian channel (PLEASE!)
Mensaje por jurrabi » 27 Ago 2010, 01:34
I did fix a problem with the "avanti" link. So now you can go forward to the next page.
I don't see the need for a "indietro" link as going back in xbmc goes to the previous page...
I attached the modified file. I tried to change the minimal to let you recognize it.
Keep the good work.
jur.
- Adjuntos
-
- cineblog01.rar
- revised cineblog01
- (1.74 KiB) Descargado 218 veces
Re: 3 italian channel (PLEASE!)
Mensaje por jurrabi » 27 Ago 2010, 22:41
I don't understand what you mean by two pieces of code. I call code to your channel program (in python). But I'm not sure if you mean pieces of data (the html data of the page).how can I set a range between two piece of code in which to search recursive expressions (rather than the whole page)?
I also don't understand what you mean by recursive... by definition regexp search for all occurrences in the data you provide. That data doesn't have to be the hole page. You can cut the page using string manipulation functions (split, search, etc).
But I can't be specific to such a generic question.
I stand recommending the python tutorial. That will give you a minimal set of tools to keep going.
Also, if you want I recomend reviewing the channel code of tvshack. It does some advanced things that might give you ideas... For example in that channels page, the episodes of a TV Series doesn't have the full episode reference (sXXeXX) in each episode. Instead it has a title for the season and then lists all the episodes for that season with a single number. The channel splits de data page into sections for each season and then recreates the full episode reference.
Re: 3 italian channel (PLEASE!)
Mensaje por otherman » 27 Ago 2010, 23:21
I've added the alfabetic list for now, and it works one step at a time
P.s. Yes, with "piece of code" I mean "html data"
Re: 3 italian channel (PLEASE!)
Mensaje por otherman » 29 Ago 2010, 12:06
changes are:
"plot" added
"Per Letter list" added (the original site has not a true alphabetical order, sorry)
"Series" added (needs more works)
"anime" added (needs more works)
"Search movie" added
And I need help here..
The url for movies search is an easy http://cineblog01.com/film/?s=TEXT
but for serise is http://cineblog01.com/serietv/?s=TEXT&submit=TROVA!
and for anime is http://cineblog01.com/anime/?s=TEXT&submit=TROVA!
than the "searchUrl = "http://cineblog01.com/film/?s="+tecleado" for movies, what become for series and anime?
Maybe "searchUrl = "http://cineblog01.com//serietv/?s="+tec ... bmit=TROVA! ?
- Adjuntos
-
- cineblog01.zip
- (2.45 KiB) Descargado 237 veces
Re: 3 italian channel (PLEASE!)
Mensaje por jesus » 16 Sep 2010, 10:44
The correct sentence is:
Código: Seleccionar todo
searchUrl = "http://cineblog01.com//serietv/?s="+tecleado+"&submit=TROVA!"
Re: 3 italian channel (PLEASE!)
Mensaje por jesus » 16 Sep 2010, 17:21
- Ayuda sobre plugins
- ↳ tvalacarta
- ↳ Problemas (no me funciona...)
- ↳ Preguntas (cómo se hace...)
- ↳ Sugerencias (estaría bien que hubiera...)
- ↳ pelisalacarta
- ↳ Problemas (no me funciona...)
- ↳ Preguntas (cómo se hace...)
- ↳ Sugerencias (estaría bien que hubiera...)
- ↳ pelisalacarta (For Italian users)
- ↳ Problemi (Non mi funziona...)
- ↳ Domande (Come fare a...)
- ↳ Suggerimenti (Sarebbe bello che...)
- ↳ mywebtv
- ↳ Problemas (no me funciona...)
- ↳ Preguntas (cómo se hace...)
- ↳ Sugerencias (estaría bien que hubiera...)
- ↳ MediaExplorer
- ↳ Balandro
- ↳ Otros plugins
- ↳ Alfa
- ↳ Alfa (For Italian users)
- ↳ Tutoriales
- Ayuda sobre mediacenters
- ↳ XBMC / Kodi
- ↳ Plex
- ↳ Android
- ↳ Raspberry Pi
- ↳ Boxee
- ↳ WiiMC
- ↳ Enigma 2
- ↳ Otros media center
- Sugerencias
- ↳ Nuevos canales
- ↳ Mejoras
- Desarrolladores
- Comunidad
¿Qué es Mi media center?
Este es el foro oficial de soporte para pelisalacarta, tvalacarta y mywebtv.
También es un lugar para compartir tus experiencias con dispositivos multimedia y software media center, puede que encuentres algo interesante que ni siquiera sabías que se podía hacer.
Primeros pasos en Kodi
Si estás empezando con Kodi, o si estás interesado en sacarle más partido, puedes echar un vistazo a esta colección de video-tutoriales.
Aprenderás a crear y optimizar tu biblioteca, a instalar add-ons, a buscar subtítulos...
Cómo reportar un problema
Si tienes un problema en alguno de los plugins y quieres reportarlo, no olvides incluir el log.
Para que resulte útil tienes que activar la opción de "log completo" en el plugin, luego reiniciar Kodi y dar los pasos necesarios hasta que se produzca el problema.
Luego copia tu fichero de log, siguiendo las instrucciones que se describen en este enlace, e inclúyelo al final de la descripción de tu problema.
Aprende a programar para Kodi
Si sabes programar, esta serie de tutoriales que describen paso a paso cómo desarrollar tu propio add-on para Kodi.
Y si quieres añadir tus propios canales a pelisalacarta también te contamos paso a paso cómo hacerlo en este enlace.
¿Quién está conectado?
Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 23 invitados