Kodi Community Forum
[RELEASE] OpenSubtitles OSD (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] OpenSubtitles OSD (Script) (/showthread.php?tid=56083)



- dny238 - 2010-01-16

I'm finding that the Sublight application is successful at returning subtitles from there site when the OpenSubtitles_OSD isn't.
This seems like a bug to me. Has anyone else experienced the same result? I can get OpenSubtitles to work about 50% of the time, and the sublight application about 90%.
If I can help make the OpenSubtitles work better, it'd be nice as I'm not always on my windows laptop.
Rob


- LoL - 2010-01-18

ral67 Wrote:... is there an option or setting to also display the real filename? sometimes opensubtitles gives multiple results for different release groups and it would be helpfull to also see how the filename is - not just the Title....

+1 Smile

Great script man! But the above would be a great improvement for those of us that have the ripgroups still in the filenames.

And a question: the "items marked sync work better" indicator, how does it work and what is it based on? does it already try to match for ripgroup, or is it something else? Thx!

Grz, LoL Wink


- amet - 2010-01-18

LoL Wrote:+1 Smile

Great script man! But the above would be a great improvement for those of us that have the ripgroups still in the filenames.

And a question: the "items marked sync work better" indicator, how does it work and what is it based on? does it already try to match for ripgroup, or is it something else? Thx!

Grz, LoL Wink

I will see what I can do. I'll add it to my to-do list.

Zeljko


- dny238 - 2010-01-18

dny238 Wrote:I'm finding that the Sublight application is successful at returning subtitles from there site when the OpenSubtitles_OSD isn't.
This seems like a bug to me. Has anyone else experienced the same result? I can get OpenSubtitles to work about 50% of the time, and the sublight application about 90%.
If I can help make the OpenSubtitles work better, it'd be nice as I'm not always on my windows laptop.
Rob

I discovered part of the problem. I have a crappy windows xp 'home' machine acting like a NAS. It gets connection limits, so I switched to using FTP as a way of accessing it while I find a way to migrate to another OS. It seems like XBMC doesn't do a good job of collecting file details from an FTP server. Not sure if I'm surprised.

Since all it has to use for lookups is the file name, it fails all the time. Sublight searches don't succeed when searching for "The Scrubs S01E01".

I wrote this block to catch standard s##e## notication in the file name, and to fix up the season and episode. (The first two, and last two lines were already there)

gui.py
Code:
search_string1 = unicode(movie_title, 'utf-8')
                movie_title1 = unicodedata.normalize('NFKD', unicode(search_string1)).encode('ascii','ignore')

                if (re.search(r"s\d{1,2}e\d{1,2}",movie_title1, re.I ) ) != None :
                        m = re.search(r"(.*)s(\d{1,2})e(\d{1,2})(.*)",movie_title1, re.I)
                        season = m.group(2)
                        episode = m.group(3)
                        movie_title1 = m.group(1) + m.group(4)
                        movie_title1 = movie_title1.strip()
                        LOG (LOG_INFO, "Title fixed: [%s],[%s],[%s]", season, episode, movie_title1 )

                if self.year == 0:
                        year = ""

Once i made those edits, the lookups on Sublight.si started working again. However, it seems for some reason that the system can't FTP these subtitles back down to the server. I don't even see a connection attempt in the FTP log. Should I stop trying to make this work? Is an FTP server a 2nd class citizen in the XBMC storage world?

Help!
Rob


- amet - 2010-01-18

dny238 Wrote:I discovered part of the problem. I have a crappy windows xp 'home' machine acting like a NAS. It gets connection limits, so I switched to using FTP as a way of accessing it while I find a way to migrate to another OS. It seems like XBMC doesn't do a good job of collecting file details from an FTP server. Not sure if I'm surprised.

Since all it has to use for lookups is the file name, it fails all the time. Sublight searches don't succeed when searching for "The Scrubs S01E01".

I wrote this block to catch standard s##e## notication in the file name, and to fix up the season and episode. (The first two, and last two lines were already there)

gui.py
Code:
search_string1 = unicode(movie_title, 'utf-8')
                movie_title1 = unicodedata.normalize('NFKD', unicode(search_string1)).encode('ascii','ignore')

                if (re.search(r"s\d{1,2}e\d{1,2}",movie_title1, re.I ) ) != None :
                        m = re.search(r"(.*)s(\d{1,2})e(\d{1,2})(.*)",movie_title1, re.I)
                        season = m.group(2)
                        episode = m.group(3)
                        movie_title1 = m.group(1) + m.group(4)
                        movie_title1 = movie_title1.strip()
                        LOG (LOG_INFO, "Title fixed: [%s],[%s],[%s]", season, episode, movie_title1 )

                if self.year == 0:
                        year = ""

Once i made those edits, the lookups on Sublight.si started working again. However, it seems for some reason that the system can't FTP these subtitles back down to the server. I don't even see a connection attempt in the FTP log. Should I stop trying to make this work? Is an FTP server a 2nd class citizen in the XBMC storage world?

Help!
Rob

The script gets season and episode from library, if the episode is scanned in the library it will work 100%. I have used it to download subs for the good part of my >3000 episode collection.

I have never tried to save to FTP, I dont have that setup. you can always tell the script to download subs in the different folder under script settings.

Zeljko


- dny238 - 2010-01-18

Amet Wrote:The script gets season and episode from library, if the episode is scanned in the library it will work 100%. I have used it to download subs for the good part of my >3000 episode collection.

I have never tried to save to FTP, I dont have that setup. you can always tell the script to download subs in the different folder under script settings.

Zeljko

Ahh. I'll see if the items which aren't working just aren't scanned yet. It seems to be set to scan frequently, but that makes sense.

Maybe i'll focus on why the downloads don't work instead then.
Thanks!
Rob


OpenSubtitles_OSD error: "This script needs to run from OSD" - Decap_dk - 2010-01-18

Hi.

I have tried installing the OpenSub..._OSD script (using XBMC Zone and Vista x86) but when i try and run the script i get the error:

Code:
This script needs to run from OSD

I am using the newest version of XBMC (downloaded yestoday) and have tried the two default skins and Rapier. All give me the same error... Have anyone gotten this as well and know a resolution for it?

The only info i have been able to find regarding this is within the script itself where the code is:

Code:
#############-----------------Is script runing from OSD? -------------------------------###############


if  not xbmc.getCondVisibility('videoplayer.isfullscreen') :

        import xbmcgui
        dialog = xbmcgui.Dialog()
        selected = dialog.ok("OpenSubtitles_OSD", "This script needs to run from OSD" ,"For More Info Visit ", "http://code.google.com/p/opensubtitles-osd/" )

And I have no clue as to solve this. Please help.

Thanks


- amet - 2010-01-18

Decap_dk Wrote:Hi.

I have tried installing the OpenSub..._OSD script (using XBMC Zone and Vista x86) but when i try and run the script i get the error:

Code:
This script needs to run from OSD

I am using the newest version of XBMC (downloaded yestoday) and have tried the two default skins and Rapier. All give me the same error... Have anyone gotten this as well and know a resolution for it?

The only info i have been able to find regarding this is within the script itself where the code is:

Code:
#############-----------------Is script runing from OSD? -------------------------------###############


if  not xbmc.getCondVisibility('videoplayer.isfullscreen') :

        import xbmcgui
        dialog = xbmcgui.Dialog()
        selected = dialog.ok("OpenSubtitles_OSD", "This script needs to run from OSD" ,"For More Info Visit ", "http://code.google.com/p/opensubtitles-osd/" )

And I have no clue as to solve this. Please help.

Thanks

You need to run this script while watching the movie. see first post or the http://code.google.com/p/opensubtitles-osd/ on how to do that.

in short, you need to enable Subtitle button under skin settings


Zeljko


- dny238 - 2010-01-19

Amet Wrote:The script gets season and episode from library, if the episode is scanned in the library it will work 100%.

Well you are absolutely correct! thanks for the clarification.

After thinking about it, I think you should warn people in the script that the content wasn't found in the library. This wasn't obvious to me and it completely improves the behavior of your script. Alternatively, you could add some code like my previous block to make it work better when the look up fails. As a user, I'd prefer to see something like, "This item wasn't found in the library, would you like to scan it into the library and try again?"

Rob


- mindweaver - 2010-01-21

Where does the debug log go? yours, not xbmc's. I have been having trouble with OSOSD lately with recent builds. It works for the first video I play. but when I start a second video and try to press the OSOSD button in video GUI xbmc crashes.

It is easily reproducable, crashes everytime.

xbmc log (without debugging activated) gives me this:
Code:
19:25:13 T:2964 M:2452389888  NOTICE: -->Python Interpreter Initialized<--
19:25:13 T:2964 M:2451509248  NOTICE: False
19:25:14 T:1480 M:2447286272   ERROR: DIRECTORY::CDirectory::GetDirectory - Error getting ?
19:25:14 T:1480 M:2447286272   ERROR: CGUIMediaWindow::GetDirectory(?) failed
19:25:14 T:2964 M:2447269888   ERROR: CThread::staticThread : Access violation at 0x1e080ca8: Reading location 0x00000020

Maybe it isn't sufficent. I will try to get you a complete debug log. Please tell me where OSOSD log is put and I will post it aswell.


- amet - 2010-01-22

mindweaver Wrote:Where does the debug log go? yours, not xbmc's. I have been having trouble with OSOSD lately with recent builds. It works for the first video I play. but when I start a second video and try to press the OSOSD button in video GUI xbmc crashes.

It is easily reproducable, crashes everytime.

xbmc log (without debugging activated) gives me this:
Code:
19:25:13 T:2964 M:2452389888  NOTICE: -->Python Interpreter Initialized<--
19:25:13 T:2964 M:2451509248  NOTICE: False
19:25:14 T:1480 M:2447286272   ERROR: DIRECTORY::CDirectory::GetDirectory - Error getting ?
19:25:14 T:1480 M:2447286272   ERROR: CGUIMediaWindow::GetDirectory(?) failed
19:25:14 T:2964 M:2447269888   ERROR: CThread::staticThread : Access violation at 0x1e080ca8: Reading location 0x00000020

Maybe it isn't sufficent. I will try to get you a complete debug log. Please tell me where OSOSD log is put and I will post it aswell.

debug log is the same as XBMC, just enable debug logging under script settings.

Zeljko


- dny238 - 2010-01-25

Are you encouraging others to make improvements to the source code on the SVN or is this forum the best was to submit suggestions for improvements.


- amet - 2010-01-25

dny238 Wrote:Are you encouraging others to make improvements to the source code on the SVN or is this forum the best was to submit suggestions for improvements.

please do not make any changes in the SVN repo code, If you want to make improvements you are more than welcome to port it or post the improvements here, or on my PM, and I will incorporate them.

Zeljko


- cloverfield - 2010-01-25

calmdown Wrote:Hey guys, I'm having a small issue when trying to implement this temporary to my Alaska skin, I've managed to add a button and so, but when the actual program launches, it does so in the background of big whooping PAUSED!!!!!! overlay..

Maybe I'm better of in finding the solution in the Alaska thread, but i figured i might as well try it here first.

this is how it looks:
Image
How did you manage to implement it in Alaska? Smile


- fidoboy - 2010-01-25

Good question, i'm also interested on getting this plugin working on Alaska skin...