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.rvm.addic7ed@matrix] 3.2.1 #2646

Merged
merged 1 commit into from
Sep 20, 2024
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
4 changes: 2 additions & 2 deletions service.subtitles.rvm.addic7ed/addic7ed/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ def parse_episode(sub_cells, languages):
download_cell = lang_cell.find_next('td', {'colspan': '3'})
download_button = download_cell.find(
'a',
class_='buttonDownload',
class_='face-button',
href=updated_download_re
)
if download_button is None:
download_button = download_cell.find(
'a',
class_='buttonDownload',
class_='face-button',
href=original_download_re
)
download_row = download_button.parent.parent
Expand Down
18 changes: 16 additions & 2 deletions service.subtitles.rvm.addic7ed/addic7ed/simple_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Response:
def __init__(self):
self.encoding: str = 'utf-8'
self.status_code: int = -1
self.headers: Dict[str, str] = {}
self._headers: Optional[HTTPMessage] = None
self.url: str = ''
self.content: bytes = b''
self._text = None
Expand All @@ -101,6 +101,17 @@ def __str__(self) -> str:
def __repr__(self) -> str:
return self.__str__()

@property
def headers(self) -> HTTPMessage:
return self._headers

@headers.setter
def headers(self, value: HTTPMessage):
charset = value.get_content_charset()
if charset is not None:
self.encoding = charset
self._headers = value

@property
def ok(self) -> bool:
return self.status_code < 400
Expand All @@ -111,7 +122,10 @@ def text(self) -> str:
:return: Response payload as decoded text
"""
if self._text is None:
self._text = self.content.decode(self.encoding)
try:
self._text = self.content.decode(self.encoding)
except UnicodeDecodeError:
self._text = self.content.decode('utf-8', 'replace')
return self._text

def json(self) -> Optional[Union[Dict[str, Any], List[Any]]]:
Expand Down
2 changes: 0 additions & 2 deletions service.subtitles.rvm.addic7ed/addic7ed/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import json
import logging
import os
import re
from collections import namedtuple

import xbmc

Expand Down
6 changes: 3 additions & 3 deletions service.subtitles.rvm.addic7ed/addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="service.subtitles.rvm.addic7ed"
name="Addic7ed.com"
version="3.2.0"
version="3.2.1"
provider-name="Roman V.M.">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
Expand Down Expand Up @@ -29,8 +29,8 @@
<icon>icon.png</icon>
<fanart>fanart.jpg</fanart>
</assets>
<news>3.2.0:
- Removed Python 2 compatibility.</news>
<news>3.2.1:
- Fixed issues with downloading subtitles.</news>
<reuselanguageinvoker>true</reuselanguageinvoker>
</extension>
</addon>
Loading