2013-05-17, 13:08
Hello everyone!
I don't have any python skills yet, but I know other programming languages and have CompSci degree. So I hope I've got the basics of programming covered. I've looked over the various wiki pages concerning add on development. From what I've gathered I'm unsure whether it is actually possible to do, what I need to do. Here are the two tasks:
1) Send Wake-On-LAN-Message (possibly by executing etherwake) when ever an NFS-Share is accessed.
2) Rewrite certain URLs, when they are accessed.
Why I need to do that:
1) My NAS is in sleep most of the day to reduce power consumption. Right now both, my girlfriend and me, use an android app to wake the file server beforen playing a movie. However, sometimes she just forgets to start it xbmc can't access the files. From the logs I can tell that xbmc generates a log message when it initializes or shuts down NFS connections. I could write a shell script to monitor the log, but since some of my client computers use windows and some linux I'm afraid that a truly portable solution will be hard to come up with. Is there a way to monitor for NFS connection attempts from a python add on?
2) I'm using MediaElch as my Media Manager to scrape all metadata and write them to nfo-files. xbmc just scrapes these local files and stores everything into a shared mysql database. Links to movie trailers are actual links to the corresponding Youtube page. These links don't automatically trigger the Youtube plugin and xbmc fails to play the trailers. I'd like to have python script to rewrite the Youtube URLs when they are accessed into working plugin-urls (e.g. plugin://plugin.video.youtube/?action=play_video&videoid=sFXGrTng0gQ). Is it possible to rewrite URLs from a python add on?
Any pointers would be greatly appreciated. If someone could tell me that this is indeed possible and what functions/classes/keywords I should look up, I'd be happy to google for them myself.
I don't have any python skills yet, but I know other programming languages and have CompSci degree. So I hope I've got the basics of programming covered. I've looked over the various wiki pages concerning add on development. From what I've gathered I'm unsure whether it is actually possible to do, what I need to do. Here are the two tasks:
1) Send Wake-On-LAN-Message (possibly by executing etherwake) when ever an NFS-Share is accessed.
2) Rewrite certain URLs, when they are accessed.
Why I need to do that:
1) My NAS is in sleep most of the day to reduce power consumption. Right now both, my girlfriend and me, use an android app to wake the file server beforen playing a movie. However, sometimes she just forgets to start it xbmc can't access the files. From the logs I can tell that xbmc generates a log message when it initializes or shuts down NFS connections. I could write a shell script to monitor the log, but since some of my client computers use windows and some linux I'm afraid that a truly portable solution will be hard to come up with. Is there a way to monitor for NFS connection attempts from a python add on?
2) I'm using MediaElch as my Media Manager to scrape all metadata and write them to nfo-files. xbmc just scrapes these local files and stores everything into a shared mysql database. Links to movie trailers are actual links to the corresponding Youtube page. These links don't automatically trigger the Youtube plugin and xbmc fails to play the trailers. I'd like to have python script to rewrite the Youtube URLs when they are accessed into working plugin-urls (e.g. plugin://plugin.video.youtube/?action=play_video&videoid=sFXGrTng0gQ). Is it possible to rewrite URLs from a python add on?
Any pointers would be greatly appreciated. If someone could tell me that this is indeed possible and what functions/classes/keywords I should look up, I'd be happy to google for them myself.