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)



- amet - 2009-09-25

frater Wrote:I have another issue I just noticed, although I don't understand yet why it doesn't alway fail.
All my movies have dots where there should be spaces (in their filename). This, because most of my movies are on a Linux NAS and I don't like to put everything in quotes.
XBMC translates these dots automatically to spaces.

I just scraped "Cougar.Town.S01E01.avi" and it gave me "Cougar Town S01E01.en.srt".. only after replacing the spaces with dots I had a working subtitle...

I would love it if this could get fixed
Keep up the good work....

I am not seeing the same results here, I just searched and downloaded subtitles(all 3 services) for "Twilight.[2008].[Eng]-DUQAšđčć.-,.avi" (not in library) and "Better.Off.Ted.S01E01.HDTV.XviD-2HD.avi " (in library), the results were "Twilight.[2008].[Eng]-DUQAšđčć.-,.en.srt " and "Better.Off.Ted.S01E01.HDTV.XviD-2HD.eng.srt" respectively.

The script is programed to use the movie/tvshow file name to name the subtitle. I am not sure why its misbehaving on your side. Maybe post the log file.

Even with the wrong name the subtitle should activate. as it activates immediately after renaming, using the same name.
frater Wrote:PS... I also noticed you use ".nl" for Dutch subtitles. I've always used ".dut" and ".eng" which both refer to the language and not the country (they speak Dutch in Belgium too)

according to Wikipedia the 2 letter code for Dutch is "nl" and for english its "en". we get that from the site search(OpenSubtitles) and sublight returns "eng", script uses that to name the file with "eng" or "en" extention. I didnt want to try and reinvent the wheel Smile

If it is in the same folder as the movie it will get activated on the next run regardless if it is "en" or eng".


Zeljko


- ChopperRob - 2009-09-25

I'm having problems with the script, since a couple of days the script fails to run.
I'm getting the following error message and i don't know how to resolve it.

/users/chopperrob/library/application support/xbmc/scripts/opensubtitle_osd/default.py, line 22, in?
__settings__ = xbmc.Settings( path=os.getvwd() )
AttributeError: 'module' object has no attribute 'Settings'

XBMC runs on a mac mini with snow leopard


- frater - 2009-09-25

Thanks for the quick reaction...
I repeated the process and it does exactly the same again

http://pastebin.com/m215ffc8c

The result will go to Q:\Subtitles which is on the XBOX harddisk. I prefer them on my NAS, but that's another topic..
Do note that I'm using the latest SVN-release


- amet - 2009-09-25

ChopperRob Wrote:I'm having problems with the script, since a couple of days the script fails to run.
I'm getting the following error message and i don't know how to resolve it.

/users/chopperrob/library/application support/xbmc/scripts/opensubtitle_osd/default.py, line 22, in?
__settings__ = xbmc.Settings( path=os.getvwd() )
AttributeError: 'module' object has no attribute 'Settings'

XBMC runs on a mac mini with snow leopard

You are using the stable XBMC build.

Quote from the first page:

Quote:You are going to need one of the SVN builds to use newest version, r22240 or higher should work but do not go higher than r22528.
If you do not want to use SVN please use OpenSubtitles_OSD v1.28 and follow the manual install instructions.

If you need more assistance let me know

Zeljko


- amet - 2009-09-25

frater Wrote:Thanks for the quick reaction...
I repeated the process and it does exactly the same again

http://pastebin.com/m215ffc8c

The result will go to Q:\Subtitles which is on the XBOX harddisk. I prefer them on my NAS, but that's another topic..
Do note that I'm using the latest SVN-release

Sorry, I should have mentioned it earlier, please enable the Debug log in script settings. I disabled it so it doesnt "spam" the XBMC log.

Zeljko


- frater - 2009-09-25

http://pastebin.com/m556a73c1

I did it with another TV-show.
This time I took Castle.S01E02.avi
The library has this show displayed as "Castle (2009)" and this is exactly how the file gets renamed in my Q:\subtitles
"Castle (2009) S01E02.en.srt"

So it somehow doesn't use the filename but its library name...


- amet - 2009-09-25

frater Wrote:http://pastebin.com/m556a73c1

I did it with another TV-show.
This time I took Castle.S01E02.avi
The library has this show displayed as "Castle (2009)" and this is exactly how the file gets renamed in my Q:\subtitles
"Castle (2009) S01E02.en.srt"

So it somehow doesn't use the filename but its library name...

It is caused by the XBOX platform restriction in the script, but regardless of the name the subtitle should activate. Does it activate the subtitle at all?

Someone mentioned that it wasnt working well on the latest build > r22528, so if you can maybe try and downgrade to r22240 - 22528.

Unfortunately I dont have the XBOX to test with but if you are willing to test let me know on PM.

Regards
Zeljko


- frater - 2009-09-25

No it doesn't the subtitle, but it does so after I rename it....
I can see in the log you are able to get hold of the filename, so you should be able to rename it properly.
I guess the function you now use is ambiguous....
I can't troubleshoot anymore this evening, but I'll be back on this tomorrow...


- amet - 2009-09-25

frater Wrote:No it doesn't the subtitle, but it does so after I rename it....
I can see in the log you are able to get hold of the filename, so you should be able to rename it properly.
I guess the function you now use is ambiguous....
I can't troubleshoot anymore this evening, but I'll be back on this tomorrow...

The only way to know the name of the file,if the movie is in the library, is to get the full path.

Quote:Search String: [Castle+(2009)+S01E02]
this string is "calculated" like this :

Title + " S0" + season +"E0" + episode

Title is name of the tvshow as you see it in OSD
season is season as you see it in OSD
episode is episode as you see it in OSD

then all the " " are replaced with "+" to form a search string

It is pure coincidence that it matches the name of your file.


on my side it shows

PHP Code:
21:28:56 T:2955558912 M14958592  NOTICEINFOSearch String: [Ice+Age]
21:28:56 T:2955558912 M14958592  NOTICEINFOTemp?: [False]
21:28:56 T:2955558912 M14958592  NOTICEINFOFile Path: [/Users/Amet/Movies/Ice Age (2002) [DVDRip.XviD].avi]
21:28:56 T:2955558912 M14958592  NOTICEINFOYear: [2002

on yours it shows:
PHP Code:
19:37:24 M11165696  NOTICEINFOSearch String: [Castle+(2009)+S01E02]
19:37:24 M11165696  NOTICEINFOTemp?: [True]
19:37:24 M11165696  NOTICEINFOFile Path: [i]
19:37:24 M11165696  NOTICEINFOYear: [0

Notice how its not getting the File Path?

Thats why we get the sub name from "Title". Script doesnt know if it had "." or not in the file name.

I wouldn't say that I am 100% sure but I think that subtitles not activating is caused by the XBMC version you are using.I know at least 5 guys here that are using XBOX with SMB drives and no one has complained.

if you try and manually add the subtitle without renaming it with "." , what happens?


- frater - 2009-09-25

Amet Wrote:Notice how its not getting the File Path?
Yes...
But I guess this is the output of your script?
PHP Code:
#19:37:25 M: 11165696   ERROR: CGUIMediaWindow::GetDirectory(?) failed
#19:37:25 M: 11165696  NOTICE: INFO: onInit
#19:37:25 M: 10432512  NOTICE: INFO: XBOX System: [v1.4]
#19:37:25 M:  9867264  NOTICE: INFO: Search by Name Castle.S01E02.avi 
Amet Wrote:Thats why we get the sub name from "Title". Script doesnt know if it had "." or not in the file name.
Now I also know why the script isn't able to put the subtitle in the right directory...
As I said it's the latest SVN and I saw several things about python mentioned in the changelog.


- amet - 2009-09-25

frater Wrote:Yes...
But I guess this is the output of your script?
PHP Code:
#19:37:25 M: 11165696   ERROR: CGUIMediaWindow::GetDirectory(?) failed
#19:37:25 M: 11165696  NOTICE: INFO: onInit
#19:37:25 M: 10432512  NOTICE: INFO: XBOX System: [v1.4]
#19:37:25 M:  9867264  NOTICE: INFO: Search by Name Castle.S01E02.avi 

Yes but that is for OpenSubtitle name search, it only gets used if the file is on XBOX smb drive or the internet steaming file.It skips the hash search.
As I said earlier, if and when you are ready to test please let me know and I will e-mail you the "new" version. I do not have the XBOX and therefore I cannot test.

frater Wrote:Now I also know why the script isn't able to put the subtitle in the right directory...
It cannot write to the smb drive that's why its saved to a custom folder.Its a XBMC issue, not the script.

If you haven't set the Subtitle folder the script should have asked you to set one.

frater Wrote:As I said it's the latest SVN and I saw several things about python mentioned in the changelog.

It could be the problem, several people are finding the issues. I have now tried the latest build for OSX and it was working, but maybe it was XBOX specific issue.... Not sure really.


- ChopperRob - 2009-09-25

Amet Wrote:You are using the stable XBMC build.

Quote from the first page:



If you need more assistance let me know

Zeljko

Thank you, it solved the problem. I'm back to version 1.28


- Bram77 - 2009-09-25

I'm using the rapier skin now and the plugin is working great!
I have some comments though. I'm not sure if they are bugs or intended this way.

1. I'm running the script on the XBOX. Every time I run the script I have to choose the subtitles directory first. Before, this was only needed once. Is this done intentionally? I think it would be nice if this could be configured from the script settings.

2. It's absolutely great that you've chosen to add these three sources for subtitles. I get a hit almost every movie or tv series I watch. The subs download nicely to the specified folder. But.... I have to take the following actions to make the sub actually work with the movie.

* Start the movie
* Run the script from the menu
* Select the directory to download to
* Select the sub to download (if a subtitle is found ofcourse)
* The subtitle doesn't start. I can try to select it manually by browsing to the downloaded sub from the sound menu in the movie, but it still won't play. So I have to stop the movie.
* Start the movie again
* No subtitle is found so I have to mannually browse to the sub from the sound menu in the movie.
* Once the subtitle is selected it does play!

I find it supurb that I can do all this with my remote whithout leaving the couch. But there might be some room for improvement? Smile
I also noticed that the subtitle doesn't have the same name as the movie I'm playing. Is this because I'm playing the movie from library mode in XBMC and is this the reason why the subtitle won't start automatically?


You've done an excelent job on the script. The popularity sais enough Smile
Sorry I haven't been there lately to help test on the XBOX. I simply haven't had the time. If there is anything I can do. Please let me know and I'll try to help whenever I can.


- amet - 2009-09-25

ChopperRob Wrote:Thank you, it solved the problem. I'm back to version 1.28

Glad you got it to work. Smile

Zeljko


- amet - 2009-09-25

Bram77 Wrote:I'm using the rapier skin now and the plugin is working great!
I have some comments though. I'm not sure if they are bugs or intended this way.

1. I'm running the script on the XBOX. Every time I run the script I have to choose the subtitles directory first. Before, this was only needed once. Is this done intentionally? I think it would be nice if this could be configured from the script settings.

You can set the custom folder in the settings menu. Is it set to default or custom?

Bram77 Wrote:2. It's absolutely great that you've chosen to add these three sources for subtitles. I get a hit almost every movie or tv series I watch. The subs download nicely to the specified folder. But.... I have to take the following actions to make the sub actually work with the movie.

* Start the movie
* Run the script from the menu
* Select the directory to download to
* Select the sub to download (if a subtitle is found ofcourse)
* The subtitle doesn't start. I can try to select it manually by browsing to the downloaded sub from the sound menu in the movie, but it still won't play. So I have to stop the movie.
* Start the movie again
* No subtitle is found so I have to mannually browse to the sub from the sound menu in the movie.
* Once the subtitle is selected it does play!

I find it supurb that I can do all this with my remote whithout leaving the couch. But there might be some room for improvement? Smile
I also noticed that the subtitle doesn't have the same name as the movie I'm playing. Is this because I'm playing the movie from library mode in XBMC and is this the reason why the subtitle won't start automatically?


You've done an excelent job on the script. The popularity sais enough Smile
Sorry I haven't been there lately to help test on the XBOX. I simply haven't had the time. If there is anything I can do. Please let me know and I'll try to help whenever I can.

Definitely room for improvement. I wish you have told me earlier.

Please check your PM... I have the test version if you can try and let me know.

Zeljko