2011-05-08, 19:27
Hello again,
So while I wait for an API or another solution for my Sratim service I've decided to create a service for another site hosting the same subtitles. I've got most of the coding done but I seem to have a "unique" problem -
The website in question displays the available subtitles using embedded python code. The data is actually in a dictionary declared in the html, e.g subs = {...}. I've considered parsing it manually, but it's a large declaration with several nesting levels, so I had to resort to exec().
The thing is the service works when imported and executed via an interpreter shell, but via xbmc it throws an unexpected EOF while parsing line. I've printed the code to the log file, it looks fine. Any ideas/known limitations when using exec?
Thanks,
Ori
Edit: So I converted the string to a raw string and it seems to execute, but the line is simply foundSubtitles = ... and when I try to print the variable on the next line it is undefined.
So while I wait for an API or another solution for my Sratim service I've decided to create a service for another site hosting the same subtitles. I've got most of the coding done but I seem to have a "unique" problem -
The website in question displays the available subtitles using embedded python code. The data is actually in a dictionary declared in the html, e.g subs = {...}. I've considered parsing it manually, but it's a large declaration with several nesting levels, so I had to resort to exec().
The thing is the service works when imported and executed via an interpreter shell, but via xbmc it throws an unexpected EOF while parsing line. I've printed the code to the log file, it looks fine. Any ideas/known limitations when using exec?
Thanks,
Ori
Edit: So I converted the string to a raw string and it seems to execute, but the line is simply foundSubtitles = ... and when I try to print the variable on the next line it is undefined.