Release - service.subtitles.subscene

  Thread Rating:
  • 4 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
CrowleyAJ Offline
Junior Member
Posts: 46
Joined: Aug 2013
Reputation: 4
Post: #46
I pushed version 0.9.2 to github. If you use the ZIP download from github keep in mind that you might haver to remove the "-master" portion from the directory as mentioned by bass63.

@NCKYTUN: This version should fix your issue.

Since throwing a full scene release file name at subscene seems to give very mixed results, I try some heuristics first to determine if its a movie (i.e. it has a year in its filename) or a TV show (it has an episode code) before just doing a file name search.
find quote
NCKYTUN Offline
Junior Member
Posts: 8
Joined: Aug 2013
Reputation: 0
Post: #47
Thanks so much CrowleyAJ and amet!!! it works perfect.
find quote
CrowleyAJ Offline
Junior Member
Posts: 46
Joined: Aug 2013
Reputation: 4
Post: #48
Glad to hear. I'll send it to the official repo then
find quote
warlion Offline
Posting Freak
Posts: 1,224
Joined: Aug 2006
Reputation: 35
Post: #49
crowley sorry about the delay t report , it work perfect i using it as default , thanks
find quote
nard Offline
Junior Member
Posts: 7
Joined: Mar 2014
Reputation: 0
Post: #50
Hello, since the last update I made I'm getting an Unicode/decode error in script when downloading a sub (wherever the sub file is) with subscene service. Logs are available in http://sprunge.us/fKRZ (last error is related to podnapisi but the previous one is subscene). Any hints ?
find quote
CrowleyAJ Offline
Junior Member
Posts: 46
Joined: Aug 2013
Reputation: 4
Post: #51
Hi nard,

thanks for your report. I had a look at it, but unfortunately I'm not sure, what to do about it. The problem occurs inside a Python library, when cleaning up the temp directory before extracting new files and there seems to be an encoding problem in a filename. Maybe someone reads this, who is bit more proficient in Python and XBMC add-on development and can give me a hint, how to solve this problem.

The error message is this:
Code:
Error Type: <type 'exceptions.UnicodeDecodeError'>
  Error Contents: 'ascii' codec can't decode byte 0xc2 in position 22: ordinal not in range(128)
  Traceback (most recent call last):
    File "/storage/.xbmc/addons/service.subtitles.subscene/service.py", line 422, in <module>
      subs = download(params["link"])
    File "/storage/.xbmc/addons/service.subtitles.subscene/service.py", line 294, in download
      shutil.rmtree(__temp__)
    File "/home/stephan/projects/openelec-4.0/build.OpenELEC-Generic.x86_64-4.0.0/Python-2.7.3/.install_pkg/usr/lib/python2.7/shutil.py", line 239, in rmtree
    File "/home/stephan/projects/openelec-4.0/build.OpenELEC-Generic.x86_64-4.0.0/Python-2.7.3/.install_pkg/usr/lib/python2.7/posixpath.py", line 71, in join
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 22: ordinal not in range(128)

And it occurs while just calling "shutil.rmtree(__temp__)". Has anyone an idea?
find quote
nard Offline
Junior Member
Posts: 7
Joined: Mar 2014
Reputation: 0
Post: #52
Perhaps I could clean the temp manually if remains there a file with some encoding error in it.
Where is this temp dir ? is it the .xbmc/temp (in that case it's already empty) ?
find quote
CrowleyAJ Offline
Junior Member
Posts: 46
Joined: Aug 2013
Reputation: 4
Post: #53
that would be .xbmc/userdata/addon_data/service.subtitles.subscene/temp/
find quote
nard Offline
Junior Member
Posts: 7
Joined: Mar 2014
Reputation: 0
Post: #54
There was an srt file probably corrupted there, I removed it manually and now it works. Thanks for your help !
find quote
shikigami Offline
Junior Member
Posts: 1
Joined: Jun 2014
Reputation: 0
Post: #55
When executing a subtitle search as soon as the video starts playing/loading on my raspberry, the addon causes an exception. Allowing the video to fully buffer and run a few seconds does not produce the exception. See below

Code:
18:28:09 T:2640110656   ERROR: EXCEPTION: XBMC is not playing any file
18:28:10 T:2640110656   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.RuntimeError'>
                                            Error Contents: XBMC is not playing any file
                                            Traceback (most recent call last):
                                              File "/home/pi/.xbmc/addons/service.subtitles.subscene/service.py", line 387, in <module>
                                                item['file_original_path'] = urllib.unquote(xbmc.Player().getPlayingFile().decode('utf-8'))  # Full path
                                            RuntimeError: XBMC is not playing any file
                                            -->End of Python script error report<--
18:28:10 T:2631722048   ERROR: GetDirectory - Error getting plugin://service.subtitles.subscene/?action=search&languages=English

I'm using raspbmc running v13 of xbmc on a raspberry pi
find quote
Mafarricos Offline
Senior Member
Posts: 210
Joined: Feb 2013
Reputation: 0
Post: #56
(2014-05-12 00:18)CrowleyAJ Wrote:  Hi nard,

thanks for your report. I had a look at it, but unfortunately I'm not sure, what to do about it. The problem occurs inside a Python library, when cleaning up the temp directory before extracting new files and there seems to be an encoding problem in a filename. Maybe someone reads this, who is bit more proficient in Python and XBMC add-on development and can give me a hint, how to solve this problem.

The error message is this:
Code:
Error Type: <type 'exceptions.UnicodeDecodeError'>
  Error Contents: 'ascii' codec can't decode byte 0xc2 in position 22: ordinal not in range(128)
  Traceback (most recent call last):
    File "/storage/.xbmc/addons/service.subtitles.subscene/service.py", line 422, in <module>
      subs = download(params["link"])
    File "/storage/.xbmc/addons/service.subtitles.subscene/service.py", line 294, in download
      shutil.rmtree(__temp__)
    File "/home/stephan/projects/openelec-4.0/build.OpenELEC-Generic.x86_64-4.0.0/Python-2.7.3/.install_pkg/usr/lib/python2.7/shutil.py", line 239, in rmtree
    File "/home/stephan/projects/openelec-4.0/build.OpenELEC-Generic.x86_64-4.0.0/Python-2.7.3/.install_pkg/usr/lib/python2.7/posixpath.py", line 71, in join
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 22: ordinal not in range(128)

And it occurs while just calling "shutil.rmtree(__temp__)". Has anyone an idea?

In latest OpenElec Release I'm having this kind of error. Usually is because of corrupt subtitle files in the temp folder of subtitle addon?

How that relates to change this:
__temp__ = xbmc.translatePath( os.path.join( __profile__, 'temp') ).decode("utf-8")
to
__temp__ = xbmc.translatePath( os.path.join( __profile__, 'temp') )

and start working all the times?
find quote
Martijn Offline
Team Kodi
Posts: 11,205
Joined: Jul 2011
Reputation: 162
Location: Dawn of time
Post: #57
That sounds wrong. A lot of addons use
__temp__ = xbmc.translatePath( os.path.join( __profile__, 'temp') ).decode("utf-8")

so i see no reason why that doesn't work. That line is exactly the reason a lot of addon DO work.

Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first

For your mediacenter artwork go to
[Image: fanarttv.png]
find quote
Mafarricos Offline
Senior Member
Posts: 210
Joined: Feb 2013
Reputation: 0
Post: #58
(2014-06-03 11:13)Martijn Wrote:  That sounds wrong. A lot of addons use
__temp__ = xbmc.translatePath( os.path.join( __profile__, 'temp') ).decode("utf-8")

so i see no reason why that doesn't work. That line is exactly the reason a lot of addon DO work.

So is more probable that is because some corrupt file in the temp folder?

Isn't there a way of prior to download files to the temp folder the addon delete any file on the folder?
find quote
Mafarricos Offline
Senior Member
Posts: 210
Joined: Feb 2013
Reputation: 0
Post: #59
I think I made a dumb question, because the problem is right with the code that tries to delete the temp folder with a corrupt file? And has to be treated manually?

So by the code:
__temp__ = xbmc.translatePath(pjoin(__profile__, 'temp')).decode("utf-8")

Is telling that variable __temp_ has the path to temp directory decoded to utf-8 and then:
Code:
"""Called when subtitle download request from XBMC."""
    # Cleanup temp dir, we recomend you download/unzip your subs in temp folder and
    # pass that to XBMC to copy and activate
    if xbmcvfs.exists(__temp__):
        shutil.rmtree(__temp__)
    xbmcvfs.mkdirs(__temp__)

The problem relies on shutil.rmtree(__temp__)
if folder is decoded I get the error, but if is not encoded I don't have, what relates with having a problem with a corrupt file?
To delete folder and every files shouldn't be the same?
find quote
meminletgo Offline
Junior Member
Posts: 2
Joined: Jul 2014
Reputation: 0
Post: #60
hi some day ago, i see problem with subscene, not working, always return not found.
My device is a iPad mini retina running iOS 7.0.4. Please help me. Thanks
find quote
Post Reply