I’m using a plugin called pelisalacarta which serves a proxy on my PC and lets you browse different media sites transforming their output (html) into plx files, so yes, it should be possible. This is coded in python as well.
It’s mostly in spanish, but you can see the code here, for what it’s worth:
http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/