Kodi Community Forum

Full Version: [DEPRECIATED] XBMC Subtitles - Addon Script (previously OpenSubtitles OSD)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Use a keymapping to start the script without being depend on the skin maker.
For instance on a Windows 7 machine:
Create a file "keyboard.xml" in "c:\Users\[your_name]\AppData\Roaming\XBMC\userdata\keymaps\"
Put the following lines in the xml file:
Code:
<keymap>
  <FullscreenVideo>
    <keyboard>
      <u>RunScript(c:\Users\[color=red][your_name][/color]\AppData\Roaming\XBMC\addons\script.xbmc.subtitles\default.py)</u>
    </keyboard>
  </FullscreenVideo>
</keymap>
And now you can start the script using the "u" key on your keyboard Big Grin
Hi, thanks Amet for the script. Simply one of the most usefull features of XBMC. Nod

I'd like to know it there is something new about the special characters issue. I did not get if this is related with the script code or with XBMC itself.

Here in my Windows, my user folder inside Documments and Settings is "João", and even if I clear the cache directory first, what happens is:

1) I get a message "Subtitle downloaded and extracted".
And yes, the file is really generated in the movie folder.

2) Then I get the message "Script failed", and then XBMC does not recognize the downloaded subtitle. I have to stop the movie and start it again.

Log:

Code:
20:45:57 T:1416 M:1307000832   ERROR: Error Type: exceptions.OSError
20:45:57 T:1416 M:1307000832   ERROR: Error Contents: (2, 'No such file or directory', 'F:\\Documents and Settings\\Jo\xc3\xa3o\\Dados de aplicativos\\XBMC\\cache\\sub_tmp\\Letters To Juliet.srt.srt')
20:45:57 T:3372 M:1307648000   ERROR: CLocalizeStrings::ClearBlock: Trying to clear non existent block F:\Documents and Settings\João\Dados de aplicativos\XBMC\addons\script.xbmc.subtitles

I wonder if this is something that could be avoided, besides the fact that I have to clear the cache folder every time. It is something a little annoying. After all this script is totally related with practicality, so we do not have to go to the website to download the subtitle. Sad
Amet Wrote:it finds the name of the movie just fine



enable parent folder search in settings and you can search using folder name if the returned results are not satisfactory.

Yes the script find the movie when i have this on, sorry for that. May i ask if there is an way, that the script can take the exact folder name and use that for searching. If it takes the whole folder name, including release grp and find that exact subtitle that one would be highest up in the list and also marked with 5 stars.

When i see the result now, i still have to figure out what subtitle to use, even do that info is in the folder that holds the movie, and also that subtitle is on the subtitle page but far down in the results. With an "Use exact folder name" search i think the confusion of taking the wrong subtitle would be minimized.

Best regards
JoaoGuilherme Wrote:Hi, thanks Amet for the script. Simply one of the most usefull features of XBMC. Nod

I'd like to know it there is something new about the special characters issue. I did not get if this is related with the script code or with XBMC itself.

Here in my Windows, my user folder inside Documments and Settings is "João", and even if I clear the cache directory first, what happens is:

1) I get a message "Subtitle downloaded and extracted".
And yes, the file is really generated in the movie folder.

2) Then I get the message "Script failed", and then XBMC does not recognize the downloaded subtitle. I have to stop the movie and start it again.

Log:

Code:
20:45:57 T:1416 M:1307000832   ERROR: Error Type: exceptions.OSError
20:45:57 T:1416 M:1307000832   ERROR: Error Contents: (2, 'No such file or directory', 'F:\\Documents and Settings\\Jo\xc3\xa3o\\Dados de aplicativos\\XBMC\\cache\\sub_tmp\\Letters To Juliet.srt.srt')
20:45:57 T:3372 M:1307648000   ERROR: CLocalizeStrings::ClearBlock: Trying to clear non existent block F:\Documents and Settings\João\Dados de aplicativos\XBMC\addons\script.xbmc.subtitles

I wonder if this is something that could be avoided, besides the fact that I have to clear the cache folder every time. It is something a little annoying. After all this script is totally related with practicality, so we do not have to go to the website to download the subtitle. Sad


it is related to the username, not much I can do on my side ATM, I will look into reproducing this issue on one of the win machines and trying different fixes for it.

you could change your username to something else Big Grin
alex84 Wrote:Yes the script find the movie when i have this on, sorry for that. May i ask if there is an way, that the script can take the exact folder name and use that for searching. If it takes the whole folder name, including release grp and find that exact subtitle that one would be highest up in the list and also marked with 5 stars.

When i see the result now, i still have to figure out what subtitle to use, even do that info is in the folder that holds the movie, and also that subtitle is on the subtitle page but far down in the results. With an "Use exact folder name" search i think the confusion of taking the wrong subtitle would be minimized.

Best regards

if you use "Search Using parent folder" option in settings it will "Use exact folder name" to search.In most cases the results of that will not be so good as the search for just a movie name.


here is an example

Code:
http://www.podnapisi.net/ppodnapisi/search?tbsl=1&sK=Robin.Hood.S02E02.HR.HDTV.XviD-BiA&sJ=2&sY=&sTS=2&sTE=2&sXML=1&lang=0

will search for "Robin.Hood.S02E02.HR.HDTV.XviD-BiA" as a release name, that sometimes would be used as folder name, and the result is zero returned subs

if you search for "Robin Hood"

Code:
http://www.podnapisi.net/ppodnapisi/search?tbsl=1&sK=Robin%20Hood&sJ=2&sY=&sTS=2&sTE=2&sXML=1&lang=0

the "Robin.Hood.S02E02.HR.HDTV.XviD-BiA" is your first result.
alex84 Wrote:Yes the script find the movie when i have this on, sorry for that. May i ask if there is an way, that the script can take the exact folder name and use that for searching. If it takes the whole folder name, including release grp and find that exact subtitle that one would be highest up in the list and also marked with 5 stars.

When i see the result now, i still have to figure out what subtitle to use, even do that info is in the folder that holds the movie, and also that subtitle is on the subtitle page but far down in the results. With an "Use exact folder name" search i think the confusion of taking the wrong subtitle would be minimized.

Best regards
The script can search for subtitles on 10 different websites.
Your prefered service is undertexter.se and this one does support using a searchterm like "Brooklyns.Finest.720p.Bluray.x264-CBGB" (from your debug log).
But like Amet points out, Podnapisi.net does not and many other services also do not support this.
So using the foldername for searching is not a good idea.

What could be done is trying to compare the search results with the foldername and/or filename.
This is what my Bierdopje.com service does: if it finds an exact match, it will mark it as "sync".
I could try to implement it on my services: undertexter.se, subscene.com, ondertitel.com, titlovi.com (coming out soon) and Bierdopje.com.
Better would be to compare the search results in the generic part of the script (gui.py). That way it will be active for all services.
I'll see if this can be introduced in a new version.
mr_blobby Wrote:Use a keymapping to start the script without being depend on the skin maker.
For instance on a Windows 7 machine:
Create a file "keyboard.xml" in "c:\Users\[your_name]\AppData\Roaming\XBMC\userdata\keymaps\"
Put the following lines in the xml file:
Code:
<keymap>
  <FullscreenVideo>
    <keyboard>
      <u>RunScript(c:\Users\[color=red][your_name][/color]\AppData\Roaming\XBMC\addons\script.xbmc.subtitles\default.py)</u>
    </keyboard>
  </FullscreenVideo>
</keymap>
And now you can start the script using the "u" key on your keyboard Big Grin

if you're gonna give out advice, it's a good idea to check that it's not poop advice. in this case it is. use RunScript(script.xbmc.subtitles), not that error prone fixed path.
spiff Wrote:if you're gonna give out advice, it's a good idea to check that it's not poop advice. in this case it is. use RunScript(script.xbmc.subtitles), not that error prone fixed path.
I'm no developer and can not read C++ source code, so I only get my information from this wiki page, which states "You must specify the full path to the script..."
Please inform me how I could have known that this was wrong.
right, anyways, error corrected. moving on
spiff Wrote:if you're gonna give out advice, it's a good idea to check that it's not poop advice. in this case it is.

Well, in my point of view, I am glad to receive any kind of help of other mates here in the forum. It is very pleasant to see friends trying to help each other, thanks mr_blobby.
To Amet. Yes i see your point, also make sense for me. Im more than happy with your script, and in the case you pointed out i totaly understand why its better that the search is for that name. Just me not understand correctly, sry for that.

To mr_blobby that would be wery nice.

Having some kind of in sync, star icon thingy that shows the user "take this sub" would be awsome, atleast on undertexter.se that i use daily.

Keep up the great work. Best regards
Anyway to bind a key to start the addon search? Instead of opening the OSD i mean.
kraaa Wrote:Anyway to bind a key to start the addon search? Instead of opening the OSD i mean.

sure, its on the previous page Sad

Code:
<keymap>
  <FullscreenVideo>
    <keyboard>
        <u>RunScript(script.xbmc.subtitles)</u>
    </keyboard>
  </FullscreenVideo>
</keymap>
Amet Wrote:sure, its on the previous page Sad

Code:
<keymap>
  <FullscreenVideo>
    <keyboard>
        <u>RunScript(script.xbmc.subtitles)</u>
    </keyboard>
  </FullscreenVideo>
</keymap>

Hahaha i guess i shouldent have disabled my subscription all my threads Tongue
New version available with some notable changes:
  • revorked OpenSubtitles search function, it should be much faster now. Thanks to Amet
  • added: new service "SubtitleSource". Thanks to Veron
  • added: new service "Titlovi". Thanks to mr_blobby
  • added: ability to use different search services for Movies and TV Shows. Thanks to mr_blobby
  • added: timeout setting. Thanks to Nektarios
  • added: more robust error handling. Thanks to Nektarios
  • fixed: "SubScene" is working again (was broken because of site redesign). Thanks to mr_blobby
  • updated: dutch translations. Thanks to mr_blobby