Skip to content

Commit

Permalink
[service.subtitles.opensubtitles-com] 1.0.2 (#2517)
Browse files Browse the repository at this point in the history
Co-authored-by: julien ramel <[email protected]>
  • Loading branch information
opensubtitlesdev and jujudellago authored Aug 28, 2023
1 parent 35c11be commit 3aecfc9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
7 changes: 7 additions & 0 deletions service.subtitles.opensubtitles-com/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ Search and download subtitles for movies and TV-Series from OpenSubtitles.com. S

REST API implementation based on tomburke25 [python-opensubtitles-rest-api](https://github.com/tomburke25/python-opensubtitles-rest-api)

v1.0.2 (2023-08-28)
- Update user agent header

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
5 changes: 4 additions & 1 deletion 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.1"
version="1.0.2"
provider-name="amet, opensubtitles, juokelis, opensubtitlesdev">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
Expand Down Expand Up @@ -52,6 +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.2 (2023-08-28)
- Update user agent header

v1.0.1 (2023-07-28)
- Remove limit of 10 subtitles for the returned values
- Fix Portuguese and Brazilian flags
Expand Down
3 changes: 3 additions & 0 deletions service.subtitles.opensubtitles-com/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v1.0.2 (2023-08-28)
- Update user agent header

v1.0.1 (2023-07-28)
- Remove limit of 10 subtitles for the returned values
- Fix Portuguese and Brazilian flags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
API_SUBTITLES = "subtitles"
API_DOWNLOAD = "download"


CONTENT_TYPE = "application/json"
REQUEST_TIMEOUT = 30

Expand Down Expand Up @@ -68,7 +69,7 @@ def __init__(self, api_key, username, password):
self.username = username
self.password = password

self.request_headers = {"Api-Key": self.api_key, "Content-Type": CONTENT_TYPE, "Accept": CONTENT_TYPE}
self.request_headers = {"Api-Key": self.api_key, "User-Agent": "Opensubtitles.com Kodi plugin v1.0.2" ,"Content-Type": CONTENT_TYPE, "Accept": CONTENT_TYPE}

self.session = Session()
self.session.headers = self.request_headers
Expand Down Expand Up @@ -216,3 +217,4 @@ def download_subtitle(self, query: Union[dict, OpenSubtitlesDownloadRequest]):
logging(f"Could not download subtitle from {subtitle.download_link}")

return subtitle

0 comments on commit 3aecfc9

Please sign in to comment.