Posts: 16
Joined: Apr 2011
Reputation:
0
cidus
Junior Member
Posts: 16
I'm using Linux XBMCbuntu, XBMC 11 Eden, last version of subtitles plugin.
Posts: 29
Joined: May 2012
Reputation:
0
Same issue here:
OpenELEC 2.0 Beta 4(1.95.4) [XBMC-Eden]
Only with Legendas.TV
Posts: 16
Joined: Apr 2011
Reputation:
0
cidus
Junior Member
Posts: 16
I changed my Linux distro from XBMCbuntu (11.10 32 bits) to Xubuntu (12.04 64 bits) and the error stopped.
Posts: 7
Joined: Jun 2012
Reputation:
0
FYI, I am seeing exactly the same error with Legendas.TV when trying to download subtitles. In the interface itself it says "Downloading subtitle" but nothing happens. The log shows the same error as in the messages above.
Ubuntu 12.04 32 bits and XBMC Eden running on a MacMini. XBMC subtitles version is 3.2.0.
Note this only seems to happen with Legendas.TV, as far as I could see.
Posts: 7
Joined: Jun 2012
Reputation:
0
So I went ahead and debuged it myself, Now I know exactky what the problem is but I am not sure how to fix it.
High level overview: It happens because python, by default, considers all strings to be ASCII strings.
In this specific case, what is happening is this:
1 - User requests legends from Legendas.TV.
2 - The XBMC subtitles add-on search for subtitles and show results.
3 - The user picks a result, which happens to be a, say, .rar file.
4 - The subtitles add-on extracts the file to a specific directory.
Up to this point, everything works as advertised. The problem starts now.
5 - For some reason, the .rar file contained a file with an UTF-8 (or unicode, not sure) name. In my case, it was a file called "Comentários.txt" ("Comments.txt).
6 - After extraction finishes, the add-on calls os.walk() to iterate through all the extracted files.
7 - Eventually os.walk() hits the file mentioned in file and boom:
14:41:48 T:2735704896 ERROR: for root, dirs, files in os.walk(extract_path, topdown=False):
14:41:48 T:2735704896 ERROR: File "/usr/lib/python2.7/os.py", line 284, in walk
14:41:48 T:2735704896 ERROR: if isdir(join(top, name)):
14:41:48 T:2735704896 ERROR: File "/usr/lib/python2.7/posixpath.py", line 71, in join
14:41:48 T:2735704896 ERROR: path += '/' + b
14:41:48 T:2735704896 ERROR: UnicodeDecodeError
14:41:48 T:2735704896 ERROR: :
14:41:48 T:2735704896 ERROR: 'ascii' codec can't decode byte 0xa0 in position 7: ordinal not in range(128)
Simply put, the "á" character is not an ascii character and this is why it fails.
One possible solution would be to somehow tell os.walk() to expect utf-8 or unicode filenames.
The problem gets messier because, due to the crash, no clean-up is made so the ofending file is never removed. So subsequent attempts to download any subtitles from Legendas.TV will also fail. At least there is a workaround:
Assuming you are using Linux and that you are logged in with the user that is running XBMC, open a terminal window then type this:
rm -rf ~/.xbmc/userdata/addon_data/script.xbmc.subtitles/sub_tmp/*
After this, Legendas.Tv will work again until you get another .rar file with a non-ascii named file.
hope this helps.
Posts: 35
Joined: Oct 2008
Reputation:
1
joeld
Junior Member
Posts: 35
Thanks for this solution Brunoga, it works wonderful.
If you don't mind, I made a pull request of your solution in Amet oficial github repository.
Posts: 3
Joined: Jul 2012
Reputation:
0
Could you help me? although already have updated the serivce.py Legendas.tv still can not download subtitles ...
20:25:34 T:140096118392576 NOTICE: -->Python Interpreter Initialized<--
20:26:31 T:140097871243136 ERROR: XBMC.Extract, No archive given
20:26:33 T:140097400182528 NOTICE: Closing subtitle stream
20:26:33 T:140097400182528 NOTICE: Opening Subtitle stream: 0 source: 1025
20:26:33 T:140097400182528 ERROR: OpenStream - Unable to create subtitle parser
20:26:33 T:140097400182528 WARNING: OpenSubtitleStream - Unsupported stream 0. Stream disabled.
20:26:35 T:140097871243136 ERROR: XBMC.Extract, No archive given
20:26:37 T:140097400182528 NOTICE: Opening Subtitle stream: 0 source: 1025
20:26:37 T:140097400182528 ERROR: OpenStream - Unable to create subtitle parser
20:26:37 T:140097400182528 WARNING: OpenSubtitleStream - Unsupported stream 0. Stream disabled.
20:26:37 T:140097871243136 ERROR: ClearBlock: Trying to clear non existent block /home/anderson/.xbmc/addons/script.xbmc.subtitles
Posts: 3
Joined: Feb 2011
Reputation:
0
Hi,
I have exatly the same problem than soldin, i´m using xbmc subtitles script 3.3.0 in xbmc Eden in ubuntu 12.04.
The log give me the same errors