Página 1 de 3

3 italian channel (PLEASE!)

Publicado: 23 Ago 2010, 16:00
por otherman
these are three great blog with a lot of material in italian

http://filmdblink.blogspot.com/
http://telefilmdblink.blogspot.com/
http://animedblink.blogspot.com/

please! it wuold be great have these channels in xbmc for all italian users!

P.S. There is any tutorial to add channel?

Re: 3 italian channel (PLEASE!)

Publicado: 24 Ago 2010, 00:05
por jurrabi
Yes, there is a tutorial in 3 parts in Spanish (http://www.mimediacenter.info/tag/tutorial/) although it might be a little outdated. You need to know Python, but it should be fairly easy.

Right now we are all pretty busy trying to get the plugin to be multi-language ready, but we always are looking for new sources, so don't give up hope.

Thanks for your comment.

Re: 3 italian channel (PLEASE!)

Publicado: 26 Ago 2010, 19:19
por otherman
Thanks. :)
I'm working on my first channel now. The first part of the tutorial is done and it works!

Re: 3 italian channel (PLEASE!)

Publicado: 26 Ago 2010, 20:18
por jurrabi
That's just great.

Don't forget to share it here when it's done so we can include it for the rest of the people that might be interested...

Re: 3 italian channel (PLEASE!)

Publicado: 26 Ago 2010, 20:22
por otherman
Yes, it's sure!

Re: 3 italian channel (PLEASE!)

Publicado: 26 Ago 2010, 21:38
por otherman
I've some problem. I hope you can help me.
1) some thumbnails have a space in the name, and they are not loaded in xbmc
2) some letters in the html code of the page are represented like a code, can i change that code to the real letter in xbmc?
3) the html code of the page use " instead of ' , and this create sintax error in the phyton code of the channel, how can i solve this?

Re: 3 italian channel (PLEASE!)

Publicado: 26 Ago 2010, 21:56
por jurrabi
Attach the channel code you already have so I can take a look at it.

In the mean time I'll answer what I can make of your questions:

1. XBMC has no problem with thumbnails having spaces in them. I would guess maybe there is a problem with the regular expresion? Only one way to be sure. Check the code.

2. That depends on the coding we are talking about. I'm gonna take a leap and guess the codes you refer to are the substitution codes for HTML code (like %20 for Space). There are some routines on the urllib library. urllib.unquote might be your solution.

Código: Seleccionar todo

Help on function unquote in module urllib:

unquote(s)
    unquote('abc%20def') -> 'abc def'.
But it also might be any other coding. Python is quite good when it comes to managing code pages... again only one way to be sure. checking the code.

3. I don't understand your question here. What I'm sure is that any page content can't create syntax errors in python. Bad programs usually does. But again. I'll need the code.

Don't give up. It gets easier with time...


EDIT: I just understood the question 3. You mean the page has double quote ( " ) characters in the code. Well, that is not a problem. I'm guessing you have the problem when creating regular expresions and you need to match a character double quote ( " )... well. you have 2 options here:
1. You can scape any charanter in a python string with the character \ (backslash). That means that if I want to get the string abc"def you can simply do this:

Código: Seleccionar todo

>>> mystring = "abc\"def"
>>> print mystring
abc"def
2. In python you can indistinctively use single ( ' ) o double ( " ) quotes to create a string. So the avobe example can be coded:

Código: Seleccionar todo

>>> mystring = 'abc"def'
>>> print mystring
abc"def
As you can see in this example the double quote does not need to be escaped because the string is surrounded by single quotes.
Even better. You can use 3 quotes to create strings and then you can use both single and double quotes in your string without the need to escape any characters (you can even include end of line characters for that matter):

Código: Seleccionar todo

>>> mystring = """Now my string has both quotes ( ' ) and double quotes ( " )"""
>>> print mystring
Now my string has both quotes ( ' ) and double quotes ( " )
I hope this helps.


Personal P.S.: This was my 300 message in this forum. I guess this means I'm not a guest visitor anymore :D
PostData Personal: Este es mi mensaje 300 en este foro. Supongo que eso significa que ya no soy un simple visitante del foro... ;)

Re: 3 italian channel (PLEASE!)

Publicado: 26 Ago 2010, 22:24
por otherman
Thank you for your help. It's my first time with coding something more than a basic html page!
the site of the channel is http://cineblog01.com/film/

Re: 3 italian channel (PLEASE!)

Publicado: 26 Ago 2010, 22:53
por jurrabi
If you have not coded before I would suggest, at least, to read the python tutorial in http://docs.python.org/tutorial/. Anyway thats brave of you.

Ok, I'm checking the code and will send to you a modified copy.

Re: 3 italian channel (PLEASE!)

Publicado: 26 Ago 2010, 23:01
por jurrabi
Ok, don't bother... Now going deeper I see many more weird things.

Let me some time to figure it out and I'll come back to you..

Edit1: I'd been spending some time with the weird codes in your texts.
For example in the Film Blue Steel – Bersaglio mortale (1989) the title has an n-dash character coded –.

Finally I was able to find out what it is. it is an HTML entity coded in decimal (you can check it here)

I haven't found yet the best way to re-encode that in python. So far I found the htmlentitydefslibrary that gives a dictionary for those codes but I still have to find out how to use it...

Código: Seleccionar todo

>>> help (htmlentitydefs)
Help on module htmlentitydefs:

NAME
    htmlentitydefs - HTML character entity references.

FILE
    c:\python26x86\lib\htmlentitydefs.py

DATA
    codepoint2name = {34: 'quot', 38: 'amp', 60: 'lt', 62: 'gt', 160: 'nbs...
    entitydefs = {'AElig': '\xc6', 'Aacute': '\xc1', 'Acirc': '\xc2', 'Agr...
    name2codepoint = {'AElig': 198, 'Aacute': 193, 'Acirc': 194, 'Agrave':...