Kodi Community Forum

Full Version: 2 python question from a noob
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, it's the first time I'm trying something with this python or anything like this so I have some noob questions.

1. I'm trying to get info from a site , so this is what i wrote:

match=re.compile('onclick="return aQ('The Terminator')').findall(link)

I'm trying to get the words "The Terminator" with (.+?) but can't because of the (') symbols.
How to do this?

2. Is it possible to get a list of movies from a site (after I get the first thing right) and connect it with the movie library in XBMC?
for example getting "The Terminator" from the site and when choose it will play the movie on your computer.
Is there any plugin that do this so I can look at how it's done?

Thanks.
psike Wrote:Hi, it's the first time I'm trying something with this python or anything like this so I have some noob questions.

1. I'm trying to get info from a site , so this is what i wrote:

match=re.compile('onclick="return aQ('The Terminator')').findall(link)

I'm trying to get the words "The Terminator" with (.+?) but can't because of the (') symbols.
How to do this?

2. Is it possible to get a list of movies from a site (after I get the first thing right) and connect it with the movie library in XBMC?
for example getting "The Terminator" from the site and when choose it will play the movie on your computer.
Is there any plugin that do this so I can look at how it's done?

Thanks.

escape characters. google is your friend.


From your movie library? No, you can't add items to your library from plugins. You can, of course, play videos from a plugin. Look at every video plugin ever for an example.
Thanks didn't know what to look for exactly.

I don't mean add them to library just play them. It will look if this movie name is on your computer already and if yes play it. No need for it to stay in library as a new item.
original html: onclick="return aQ('The Terminator')

regex: onclick=\"return aQ\('(.+?)'

If you want a single match use a search not a findall.

ie.

Quote:matches = re.search("onclick=\"return aQ\('(.+?)'", data, re.IGNORECASE)
if matches:
value = match.group(1)
else:
value = ""