Kodi Community Forum
[RELEASE] XBMC Subtitles - Addon Script - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Subtitle Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=143)
+---- Thread: [RELEASE] XBMC Subtitles - Addon Script (/showthread.php?tid=126495)



RE: [RELEASE] XBMC Subtitles - Addon Script - itachi46 - 2012-09-13

(2012-09-13, 14:51)amet Wrote:
(2012-09-13, 14:47)itachi46 Wrote: Hi guys having some issues with OpenSubtitles.. it finds the list of subtitles fine but when i select it, it says "error extracting subtitles", logs says file is not a zip so i checked it out, and its true the file downloaded is a html page saying "file not found" is this a known issue? i tried searching this thread to no avail...

happens when their servers are overloaded, nothing we can do on this end... have you tried few minutes later?

i've been trying for a few days now hoping that to be the case...


is there any good alternative to OpenSubtitle for english tv series /movies?



RE: [RELEASE] XBMC Subtitles - Addon Script - amet - 2012-09-13

(2012-09-13, 14:52)itachi46 Wrote:
(2012-09-13, 14:51)amet Wrote:
(2012-09-13, 14:47)itachi46 Wrote: Hi guys having some issues with OpenSubtitles.. it finds the list of subtitles fine but when i select it, it says "error extracting subtitles", logs says file is not a zip so i checked it out, and its true the file downloaded is a html page saying "file not found" is this a known issue? i tried searching this thread to no avail...

happens when their servers are overloaded, nothing we can do on this end... have you tried few minutes later?

i've been trying for a few days now hoping that to be the case...


is there any good alternative to OpenSubtitle for english tv series /movies?

podnapisi is good, you do need to register, its free


RE: [RELEASE] XBMC Subtitles - Addon Script - itachi46 - 2012-09-13

(2012-09-13, 15:06)amet Wrote: podnapisi is good, you do need to register, its free

podnapisi returns "no subtitles found" for just about everything i throw at it... and I did create an account... is OpenSubtitles working for everyone else?

edit: started poking around in the source code... in OpenSubtitles service.py,

in the download_subtitle method it is getting the correct link and if i download through wget or the browser from that link it works... its 3am here and i have to be at uni tomorrow morning so I need to sleep... my guess is something goes weirdly wrong with the extraction because I don't see anything wrong with the downloading code... will keep you guys posted.


RE: [RELEASE] XBMC Subtitles - Addon Script - dny238 - 2012-09-15

I can't get OpenSubtitles to work today. I'm getting the following when I turn up debugging.

19:35:58 T:114931520 DEBUG: GetZipList - Processing zip://%2fhome%2fxbmc%2f%2exbmc%2fuserdata%2faddon%5fdata%2fscript%2exbmc%2esubtitles%2fsub%5ftmp%2fzipsubs%2ezip/
19:35:58 T:114931520 DEBUG: ZipManager: not a zip file!

I tried to unzip the file by hand and it doesn't work, it's there, but not valid.

cat'ing the file I get HTML instead of a zip.
Thoughts?
Rob

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script><meta http-equiv="content-type" content="text/html; charset=utf-8" /><meta http-equiv="content-style-type" content="text/css" /><meta name="google-site-verification" content="YlFQS0yGw4Oazpbdw4c5BCqjXVR2nlPIuSKiMfvhA6k" /><meta name="keywords" content="" /><meta name="description" content="" /><meta name="revisit-after" content="7 days" /><link rel="shortcut icon" type="image/x-icon" href="http://static.opensubtitles.org/favicon.ico" /><link rel="search" type="application/opensearchdescription+xml" title="OpenSubtitles.org search" href="/en/opensearch/sublanguageid-all" /><link rel="index" href="/en/" /><link rel="help" href="/en/faq" /><link rel="search" href="/en/search" /><link rel="copyright" href="/en/copyright" /><link rel="author" href="/en/contact" /><link rel="bookmark" href="/en/download/subad/3629076" title="" /><meta name="robots" content="noindex,nofollow" /><link rel="stylesheet" type="text/css" href="http://www.opensubtitles.org/style.css" /><title></title><style type="text/css" media="screen"><!--[if lt IE 7]>




RE: [RELEASE] XBMC Subtitles - Addon Script - itachi46 - 2012-09-15

@dny238

I am having the same problem and it is a very weird one!.

I extracted the link used to download and if i use any other program to download that link (including another python script) it works fine... the moment i run it through xbmc i get a html saying "file not found"

I even changed the way it downloads on the service.py script to : urllib.urlretrieve ("http://dl.opensubtitles.org/en/download/subad/4128556", zip_subs) and urllib.urlretrieve (subtitles_list[pos][ "link" ], zip_subs+'blah.zip')

both returning the same file not found html instead of the zip. my testing python script which is the following:
Code:
import urllib

urllib.urlretrieve("http://dl.opensubtitles.org/en/download/subad/4128556",'test.zip')

works as expected...

I honestly don't know where to go from here... (these scripts were run from the same machine)



RE: [RELEASE] XBMC Subtitles - Addon Script - amet - 2012-09-15

I have just tried your link here, it works as expected in Subtitle script, in browser or in python terminal window ... not sure what the issue might be on your end

EDIT: you dont have proxy enabled on the machine or in XBMC?


RE: [RELEASE] XBMC Subtitles - Addon Script - itachi46 - 2012-09-15

(2012-09-15, 08:07)amet Wrote: I have just tried your link here, it works as expected in Subtitle script, in browser or in python terminal window ... not sure what the issue might be on your end

EDIT: you dont have proxy enabled on the machine or in XBMC?

mine works from browser + python terminal window aswell.. it is only when run through subtitle add-on in xbmc that it downloads a "file not found" html...

afaik, urllib is sessionless right? so no cookies/tokens are being stored... the only thing I can think of is the libraries used by the xbmc python lib vs the system python lib

edit[SOLVED]

o gosh i feel really silly now, i just checked my proxy settings on xbmc... some reason it was enabled.... Sad sorry for all the trouble Sad


RE: [RELEASE] XBMC Subtitles - Addon Script - amet - 2012-09-15

^^ 99% of the problem in here Smile


RE: [RELEASE] XBMC Subtitles - Addon Script - gabomdq - 2012-09-16

I've seen this mentioned before but I'm not sure if it's supposed to be fixed, see my log file: http://xbmclogs.com/show.php?id=8627

This happened when downloading from subdivx.com, the error is:

'ascii' codec can't decode byte 0xa2 in position 34: ordinal not in range(128)

edit: log with debug enabled http://xbmclogs.com/show.php?id=8631



RE: [RELEASE] XBMC Subtitles - Addon Script - brandytrop - 2012-09-19

hey guys, great work with this add-on - comes in very handy!

One question though, for some of my movies I already have subtitles. Your add-on also recognises that with sth like "Local subtitle found". My only question: How do I switch to my "own" subtitles?

Thanks!


RE: [RELEASE] XBMC Subtitles - Addon Script - baroumas - 2012-09-19

A quick fix for SubScene.com is to change:
main_url = "http://subscene.com/"
to
main_url = "http://v2.subscene.com/"
in service.py


RE: [RELEASE] XBMC Subtitles - Addon Script - jadas - 2012-09-23

First of all thanks for the great plugin.

What I like most is using it with Navix.
Most of the time it works perfectly, but sometimes it doesn't.

One such case happens when I use opensubtitles.org for links like this;

http://media-b68.putlocker.com/download/6/47/episode.flv?h=oR4dauykTat123pcCLA9nQ&e=1355529410&f='episode.flv'

What happens is the plugin downloads the sub just fine in AppData\Roaming\XBMC\userdata\addon_data\script.xbmc.subtitles\sub_tmp folder , but then it tries to move it to sub_stream folder with a name like this;

episode.flv?h=oR4dauykTat123pcCLA9nQ&e=1355529410&f='episode.flv.srt

As you may notice there is an "?" which Windows doesn't support in filenames.

As a workaround I changed gui.py to detect if the file is from http and be copied to sub_stream folder with a fixed name, like this (changed part between asterisks);


Code:
def Download_Subtitles( self, pos, auto = False, gui = True ):
    if gui:
      if auto:
        self.getControl( STATUS_LABEL ).setLabel(  _( 763 ) )
      else:
        self.getControl( STATUS_LABEL ).setLabel(  _( 649 ) )
    zip_subs = os.path.join( self.tmp_sub_dir, "zipsubs.zip")
    zipped, language, file = self.Service.download_subtitles(self.subtitles_list,
                                                             pos,
                                                             zip_subs,
                                                             self.tmp_sub_dir,
                                                             self.sub_folder,
                                                             self.session_id
                                                             )
    sub_lang = str(languageTranslate(language,0,2))

    if zipped :
      self.Extract_Subtitles(zip_subs,sub_lang, gui)
    else:
      sub_ext  = os.path.splitext( file )[1]
      sub_name = os.path.splitext( os.path.basename( self.file_original_path ) )[0]

      #************************************************************************************
      if ( self.file_original_path.find("http") > -1 ):
        sub_name = "temp"
      #************************************************************************************


Would it be possible to make a proper fix ?

Thanks for your time,
Jadas.


RE: [RELEASE] XBMC Subtitles - Addon Script - amet - 2012-09-23

try with this -> https://github.com/amet/script.xbmc.subtitles/commit/3e2858a72875f24cce7d04828235f160c1233b0a


RE: [RELEASE] XBMC Subtitles - Addon Script - jadas - 2012-09-24

(2012-09-23, 20:48)amet Wrote: try with this -> https://github.com/amet/script.xbmc.subtitles/commit/3e2858a72875f24cce7d04828235f160c1233b0a

It works great. Thanks.


search string issues with UPnP - Artanicus - 2012-09-24

Having issues of matching videos to subtitles when they're served over UPnP. Already made a bug in the wrong place, reproduced below even though my initial guestimate was somewhat wrong.
======
"Using raspbmc but this relates to script.xbmc.subtitles so I hope that has nothing to do with it.

When playing video over UPnP, script.xbmc.subtitles tries to search either via filename or parent directory name. With UPnP both of these are either API bits or numeric id's and as such useless. A relevant log line to illustrate; 15:40:34 T:1102639104 NOTICE: COMXPlayer: Opening: http://192.168.10.1:8200/MediaItems/16289.avi

Could you add an option for seaching with the UPnP provided original filename? They're already handled fairly well, even in the add-on the correct name is displayed at the top, only not used for the search itself. Kinda sucks to manually type out every single search with a remote :-)"
======

Since I don't see an option to attach a file, debug.log here: http://arcadia.nocturnal.fi/xbmc.log.txt .. interesting bits with debug enabled at the bottom.

Looking at the full debug output my original guestimate is wrong, the retrieved filename is used in most cases (raw filename used apparently as a fallback, for prepopping the manual search and some debug output at least..) The main problem seems to be that since the stream is assumed non-hashable the only method to search with is the "filename" which in my case doesn't seem to match on any site where it actually gets pushed.

Grepping through your source it seems there are various ways to do hashing but most depend on some basic hash of a limited set of the file data. Even though the files are served over http it is possible to grab a byte range to generate a hash, e.g. in bash:
curl -r 0-5242880 http://192.168.10.1:8200/MediaItems/16296.avi | md5sum
.. should be simple in python as well but might be out of scope for a single add-on? Seems you're doing some of the hashing via XBMC libraries and some manually.

Looking at the UPnP specs the file size and duration can be queried so if those are helpful for searches they are be available (screenshot of UPnP Inspector data: http://arcadia.nocturnal.fi/inspect.png) .. But this seems out of scope as well if the XBMC UPnP client implementation doesn't already pass that down to add-ons.

And then there's the simpler fix of pre-popping the manual search with "Movie/Episode Title" instead of what's parsed from the File Path. It should be interchangeable for local files, maybe?

Other oddities include the year being populated as 2012. Could that be grabbed from UPnP directly? The file is timestamped for August 2012 but relying on the file creation time seems counter intuitive as a release year.

Any more info or help you need, just shout, or if you like real time comms better, I'm on Freenode as Artanicus.