Opensubtitles saving Brazilian subtitles without language code.
#1
Hello,

There's been an long time issue with opensubtitles addon that Brazilian subtitles downloaded from don't have the language code and are named to something like "Movie..srt" instead of "Movie.pb.srt".

It is mentioned in a post from 2013 (https://forum.kodi.tv/showthread.php?tid=181177) and that post suggested to add a kind of fix with advancedsettings.xml. I've always done that.

But recently I found out there was already a "solution" implemented on opensubtitles addon that stopped working because opensubtitles changed the name given to Brazilian subtitles from "Brazilian" to "Portuguese (BR)".

So I made this small fix on the "service.py" file to make kodi write the language code on downloaded Brazilian subtitles filenames.

I changed the line
Code:
if item_data["LanguageName"] == "Brazilian":
item_data["LanguageName"] = "Portuguese (Brazil)"

to
Code:
if item_data["LanguageName"] == "Portuguese (BR)":
item_data["LanguageName"] = "Portuguese (Brazil)"

On my end, it's working on Kodi Leia and also on kodi matrix. Subtitles are downloaded with "pb.srt" extension and area correctly seen by kodi as "Portuguese (Brazil)" without the language code fix on advancedsettings.xml.

I've made pull requests on github repositories "opensubtitles/service.subtitles.opensubtitles" and the one forked by @juokelis "juokelis / service.subtitles.opensubtitles". But I'm not sure who maintains the addon I'm also sharing it here.

Matrix version: https://github.com/psicotron3/service.su...ee/patch-1

Leia version: https://github.com/psicotron3/service.su...ee/patch-2
Reply

Logout Mark Read Team Forum Stats Members Help
Opensubtitles saving Brazilian subtitles without language code.0