XBMC Subtitles - Legendas.TV not working properly.
#31
I'm using Linux XBMCbuntu, XBMC 11 Eden, last version of subtitles plugin.
Reply
#32
Same issue here:

OpenELEC 2.0 Beta 3(1.95.3) [XBMC-Eden]

Code:
log removed

Reply
#33
(2012-05-15, 03:42)joeld Wrote: Same issue here:

OpenELEC 2.0 Beta 3(1.95.3) [XBMC-Eden]

Code:
log removed

Do a proper Debug Log please
Reply
#34
Same issue here:

OpenELEC 2.0 Beta 4(1.95.4) [XBMC-Eden]

Only with Legendas.TV
Reply
#35
A proper debug Log:

http://pastebin.com/UpZNFcuq

The error still persisit in the last Beta 4 OpenElec
Reply
#36
I changed my Linux distro from XBMCbuntu (11.10 32 bits) to Xubuntu (12.04 64 bits) and the error stopped.
Reply
#37
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.
Reply
#38
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.

Reply
#39
Last post, I promise. Smile

So I guess I figured it out. If the initial directory passed to os.walk() uses the correct encoding, everything should work as expected. No proper diff as this is just a quick and dirty fix, but basically just do this:

(~/.xbmc/addons/script.xbmc.subtitles/resources/lib/services/LegendasTV/service.py)

67: fs_encoding = sys.getfilesystemencoding()
68: for root, dirs, files in os.walk(extract_path.encode(fs_encoding), topdown=False):

You just add the first line as line 67 and then change the other line (now 68) as above.

This should guarantee that it will work on any platforms as it always uses whatever the system reports as being the encoding used for its filesystems.

Reply
#40
Awesome brunoga, thanks.

You can submit the changes by pushing to the github repo.
https://github.com/amet/script.xbmc.subtitles
Reply
#41
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.
Reply
#42
Hey joeld.

Not at all. Thanks fort doing that. This is the beauty of open-source, right? Smile I would not be able to do it until next weekend in any case.

While we are at it, I created a generic solution for detecting when remote control buttons are being held (it requires that you are using Lirc tough). Any ideas if anyone did work on anything like that? If not, I will simply create a new project and publish it. Otherwise I can check if my solution does anything that may be interesting to the existing project and simply contribute it.

Thanks again.
Reply
#43
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
Reply
#44
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
Reply
#45
whenever i try to download subtitles.. it lists them.. but when i try to download one of them... it just stays at downloading forever..

here is a debug log

http://www.xbmclogs.com/show.php?id=6372
Reply

Logout Mark Read Team Forum Stats Members Help
XBMC Subtitles - Legendas.TV not working properly.0