Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[service.subtitles.opensubtitles-com] 1.0.1 #2500

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions service.subtitles.opensubtitles-com/addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="service.subtitles.opensubtitles-com"
name="OpenSubtitles.com"
version="1.0.0"
version="1.0.1"
provider-name="amet, opensubtitles, juokelis, opensubtitlesdev">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
Expand Down Expand Up @@ -52,8 +52,9 @@
<description lang="zh_CN">多语种的电影及剧集字幕,每日更新千余条翻译好的字幕。免费下载,提供API接口,已拥有上百万的用户。</description>
<disclaimer lang="en_GB">Users need to provide OpenSubtitles.com username and password in add-on configuration. This is our new extension, old opensubtitles.org will not work on this, but the account can be easily imported on opensubtitles.com.</disclaimer>
<news>
v1.0.0 (2022-05-09) by opensubtitles
- Moving to OpenSubtitles.com REST API.
v1.0.1 (2023-07-28)
- Remove limit of 10 subtitles for the returned values
- Fix Portuguese and Brazilian flags
</news>
<platform>all</platform>
<license>GPL-2.0-only</license>
Expand Down
4 changes: 4 additions & 0 deletions service.subtitles.opensubtitles-com/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v1.0.1 (2023-07-28)
- Remove limit of 10 subtitles for the returned values
- Fix Portuguese and Brazilian flags

1.0.0
Initial version, forked from https://github.com/juokelis/service.subtitles.opensubtitles
Search fixed and improved
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
msgid ""
msgstr ""
"Project-Id-Version: XBMC Main Translation Project (Frodo)\n"
"Report-Msgid-Bugs-To: http://trac.xbmc.org/\n"
"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2023-01-21 HO:MI+ZONE\n"
"Last-Translator: XBMC Translation Team\n"
"Language-Team: English (http://www.transifex.com/projects/p/XBMC-Main-Frodo/language/en/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

msgctxt "#32001"
msgid "Error searching for subtitles"
msgstr "Hiba a feliratok keresése közben"

msgctxt "#32002"
msgid "Plugin is not properly configured, insert valid OpenSubtitles.com username and password."
msgstr "A beépülő modul nincs megfelelően konfigurálva, írjon be érvényes OpenSubtitles.com felhasználónevet és jelszót"

msgctxt "#32003"
msgid "Unable to authenticate. Check your OpenSubtitles.com username, password."
msgstr "Nem sikerült hitelesíteni. Ellenőrizze OpenSubtitles.com felhasználónevét és jelszavát"

msgctxt "#32004"
msgid "You have reached OpenSubtitles.com download limit. Get a VIP subscription or try again tomorrow."
msgstr "Elérte az OpenSubtitles.com letöltési korlátját. Vegyél egy VIP-előfizetést, vagy próbáld újra holnap"

msgctxt "#32006"
msgid "You have reached OpenSubtitles.com download limit for unauthenticated users. Create an account on opensubtitles.com and enter your credentials in addon settings, or try again tomorrow."
msgstr "Elérte az OpenSubtitles.com letöltési korlátját a nem hitelesített felhasználók számára. Hozzon létre egy fiókot az opensubtitles.com oldalon, és adja meg hitelesítő adatait a kiegészítő beállításaiban, vagy próbálkozzon újra holnap."

msgctxt "#32101"
msgid "Login Details"
msgstr "Bejelentkezési adatok"

msgctxt "#32201"
msgid "Username"
msgstr "Felhasználónév"

msgctxt "#32202"
msgid "Password"
msgstr "Jelszó"

msgctxt "#32203"
msgid "API Key"
msgstr "API kulcs"

msgctxt "#32102"
msgid "Subtitle Options"
msgstr "Feliratok beállításai"

msgctxt "#32211"
msgid "Hearing Impaired"
msgstr "Hallássérült"

msgctxt "#32212"
msgid "Foreign Parts Only"
msgstr "Csak külföldi"

msgctxt "#32213"
msgid "Machine Translated"
msgstr "Gépi fordítás"
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
msgid ""
msgstr ""
"Project-Id-Version: XBMC Main Translation Project (Frodo)\n"
"Report-Msgid-Bugs-To: http://trac.xbmc.org/\n"
"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2023-01-27 HO:MI+ZONE\n"
"Last-Translator: Sopor\n"
"Language-Team: English (http://www.transifex.com/projects/p/XBMC-Main-Frodo/language/en/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: sv\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

msgctxt "#32001"
msgid "Error searching for subtitles"
msgstr "Fel vid sökning efter undertexter"

msgctxt "#32002"
msgid "Plugin is not properly configured, insert valid OpenSubtitles.com username and password."
msgstr "Tillägget är inte korrekt konfigurerad, ange ett giltigt användarnamn och lösenord för opensubtitles.com."

msgctxt "#32003"
msgid "Unable to authenticate. Check your OpenSubtitles.com username, password."
msgstr "Det går inte att logga in. Kontrollera ditt användarnamn och lösenord för opensubtitles.com."

msgctxt "#32004"
msgid "You have reached OpenSubtitles.com download limit. Get a VIP subscription or try again tomorrow."
msgstr "Du har nått nerladdningsgränsen för OpenSubtitles.com. Skaffa en VIP-prenumeration eller försök igen i morgon."

msgctxt "#32006"
msgid "You have reached OpenSubtitles.com download limit for unauthenticated users. Create an account on opensubtitles.com and enter your credentials in addon settings, or try again tomorrow."
msgstr "Du har nått nerladdningsgränsen för ej inloggade användare på opensubtitles.com. Skaffa en konto på opensubtitles.com och ange dina inloggningsuppgifter i tilläggets inställningar eller försök igen i morgon."

msgctxt "#32101"
msgid "Login Details"
msgstr "Inloggningsdetaljer"

msgctxt "#32201"
msgid "Username"
msgstr "Användarnamn"

msgctxt "#32202"
msgid "Password"
msgstr "Lösenord"

msgctxt "#32203"
msgid "API Key"
msgstr "API-nyckel"

msgctxt "#32102"
msgid "Subtitle Options"
msgstr "Undertextalternativ"

msgctxt "#32211"
msgid "Hearing Impaired"
msgstr "Hörselskadad"

msgctxt "#32212"
msgid "Foreign Parts Only"
msgstr "Endast delar med främmande språk"

msgctxt "#32213"
msgid "Machine Translated"
msgstr "Maskinöversatt"
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ def convert_language(language, reverse=False):
else:
return xbmc.convertLanguage(language, xbmc_param)

def get_flag(language_code):
language_list = {
"pt-pt": "pt",
"pt-br": "pb"
}
return language_list.get(language_code.lower(), language_code)


def clean_feature_release_name(title, release, movie_name=""):
if not title:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import xbmcvfs

from resources.lib.data_collector import get_language_data, get_media_data, get_file_path, convert_language, \
clean_feature_release_name
clean_feature_release_name, get_flag
from resources.lib.exceptions import AuthenticationError, ConfigurationError, DownloadLimitExceeded, ProviderError, \
ServiceUnavailable, TooManyRequests
from resources.lib.file_operations import get_file_data
Expand Down Expand Up @@ -132,11 +132,7 @@ def download(self):

def list_subtitles(self):
"""TODO rewrite using new data. do not forget Series/Episodes"""
x = 0
for subtitle in self.subtitles:
x += 1
if x > 10:
return
attributes = subtitle["attributes"]
language = convert_language(attributes["language"], True)
log(__name__, attributes)
Expand All @@ -146,7 +142,7 @@ def list_subtitles(self):
label2=clean_name)
list_item.setArt({
"icon": str(int(round(float(attributes["ratings"]) / 2))),
"thumb": attributes["language"]})
"thumb": get_flag(attributes["language"])})
list_item.setProperty("sync", "true" if ("moviehash_match" in attributes and attributes["moviehash_match"]) else "false")
list_item.setProperty("hearing_imp", "true" if attributes["hearing_impaired"] else "false")
"""TODO take care of multiple cds id&id or something"""
Expand Down
Loading