2011-03-01, 20:42
Okay, so this is where I am so far:
However when trying to use the built in zip extraction feature the OSD just closes and the new subtitles fail to play.
Amet/anyone, could you try and help me?
Here is the code for downloading the file:
And here is the debug logfile (I'm currently overwriting Titlovi for easier testing and integration):
I could of course extract the files myself but since you have a built in operation mode that handles that I'd rather not.
After I work out this bug I still need to fix one annoying problem with the search results (searching for "episode 1" returns episodes 1,10,11,12 etc' - I got a refined re pattern lined up), do some documenting and create the logo artwork . Almost there...
- I search successfully for the given title, both tv show and movie
- I open each of the result pages and parse them for the required data
- I return a valid subtitles_list, filtered by the requested languages
- I build the correct file URL which is a valid zip file
However when trying to use the built in zip extraction feature the OSD just closes and the new subtitles fail to play.
Amet/anyone, could you try and help me?
Here is the code for downloading the file:
Code:
# Get the file content using geturl()
content = getURL(url)
if content:
# Going to write them to standrad zip file (always zips in sratim)
local_tmp_file = os.path.join(tmp_sub_dir, "zipsubs.zip")
log( __name__ ,"%s Saving subtitles to '%s'" % (debug_pretext, local_tmp_file))
try:
local_file_handle = open(local_tmp_file, "wb")
local_file_handle.write(content)
local_file_handle.close()
except:
log( __name__ ,"%s Failed to save subtitles to '%s'" % (debug_pretext, local_tmp_file))
# Standard output -
# True iff the file is packed as zip,
# language of subtitles,
# filename If file not packed (or if we unpacked it ourselves)
return True, language, ""
And here is the debug logfile (I'm currently overwriting Titlovi for easier testing and integration):
Code:
20:29:04 T:8020 M:1227710464 DEBUG: ### [XBMC Subtitles-services.Titlovi.service] - Fetching subtitles using url http://www.sratim.co.il/downloadsubtitle.php?id=57959
20:29:04 T:8020 M:1227710464 DEBUG: ### [XBMC Subtitles-services.Titlovi.service] - Getting url: http://www.sratim.co.il/downloadsubtitle.php?id=57959
20:29:05 T:8020 M:1227816960 DEBUG: ### [XBMC Subtitles-services.Titlovi.service] - Saving subtitles to 'C:\Program Files\XBMC\portable_data\userdata\addon_data\script.xbmc.subtitles\sub_tmp\zipsubs.zip'
20:29:05 T:8020 M:1227141120 NOTICE: Regex File Se: 1, Ep: 03,
20:29:05 T:2180 M:1227087872 NOTICE: Closing subtitle stream
20:29:05 T:2180 M:1227087872 NOTICE: Opening Subtitle stream: 0 source: 1025
20:29:05 T:2180 M:1227087872 ERROR: CDVDPlayerSubtitle::OpenStream - Unable to create subtitle parser
20:29:05 T:2180 M:1227083776 WARNING: CDVDPlayer::OpenSubtitleStream - Unsupported stream 0. Stream disabled.
I could of course extract the files myself but since you have a built in operation mode that handles that I'd rather not.
After I work out this bug I still need to fix one annoying problem with the search results (searching for "episode 1" returns episodes 1,10,11,12 etc' - I got a refined re pattern lined up), do some documenting and create the logo artwork . Almost there...