2 python question from a noob
#1
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.
Reply
#2
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.
Always read the XBMC online-manual, FAQ and search and search the forum before posting.
For troubleshooting and bug reporting please read how to submit a proper bug report.

If you're interested in writing addons for xbmc, read docs and how-to for plugins and scripts ||| http://code.google.com/p/xbmc-addons/
Reply
#3
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.
Reply
#4
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 = ""
Retired from Add-on dev
Reply

Logout Mark Read Team Forum Stats Members Help
2 python question from a noob0