2011-02-27, 23:16
gui.py has all the answers line 279?
Code:
zip_subs = os.path.join( self.tmp_sub_dir, "zipsubs.zip")
zip_subs = os.path.join( self.tmp_sub_dir, "zipsubs.zip")
Jani Wrote:Is there any way to make this addon appear right after hitting play if there's no subtitle track?
amet Wrote:unfortunately not, that would require changes in xbmc coreToo bad. I wonder if the devs would be willing to implement a callback of some sort when a video starts playing? Or has this been discussed earlier?
simondagman Wrote:Hey!This is a known problem and it will be fixed in the next version.
First of all, thanks for an awesome addon, couldnt be more happy about it
Though I've been having som problems with it.
When I locate the correct sub for my release It wont start the download, the only thing it does is change the words to download and then nothing happens.
The weird thing is that it works with a couple of Movies/tvshows sometimes but most of the times it just freezes.
I have my target for subs to a different folder. Is that part of the problem?
Here is my log: http://pastebin.com/GR3h7RYs
Thank you.
2.3.5
- Corrected the fix for the problem of failing services on Unix with unpacking subtitle file
2.3.4
- fixed: On Unix some services failed in using the unpacked subtitle file
- added: more tvshow regex for file mode search
# 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, ""
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.
import urllib2
req_headers = {
'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.A.B.C Safari/525.13',
'Referer': 'www.sratim.co.il'}
request = urllib2.Request(url, headers=req_headers)
opener = urllib2.build_opener()
response = opener.open(request)
content = response.read()
#content = get_url(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'" % ("", local_tmp_file))
try:
local_file_handle = open(zip_subs, "w" + "b")
local_file_handle.write(content)
local_file_handle.close()
except:
log( __name__ ,"%s Failed to save subtitles to '%s'" % ("", 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, ""
Quote:dont clip the log, also attach the full .py file so that we can test as well.I'm new to the forum, didn't think that much information would be appreciated... sorry.
Quote:you might be getting two files in a zip, srt and txt. if txt gets activated it will show nothing.That's exactly it! I assumed the addon will look for resulting srt/sub to play, but when I think of it that's kind of a foolish assumption since some subtitles are .txt and the problem is the content not the extension.