From ce6466ca1af43bb80f25592bedcfe450f87e25b9 Mon Sep 17 00:00:00 2001 From: Porzino Date: Sat, 21 Dec 2019 18:13:49 +0100 Subject: [PATCH 1/7] Added support to www.subtitulamos.tv/ --- medusa/init/__init__.py | 1 + medusa/subtitle_providers/subtitulamos.py | 240 ++++++++++++++++++ medusa/subtitles.py | 1 + tests/test_subtitles.py | 1 + .../static/images/subtitles/subtitulamos.png | Bin 0 -> 440 bytes .../assets/img/subtitles/subtitulamos.png | Bin 0 -> 440 bytes .../assets/img/subtitles/subtitulamos.png | Bin 0 -> 440 bytes 7 files changed, 243 insertions(+) create mode 100644 medusa/subtitle_providers/subtitulamos.py create mode 100644 themes-default/slim/static/images/subtitles/subtitulamos.png create mode 100644 themes/dark/assets/img/subtitles/subtitulamos.png create mode 100644 themes/light/assets/img/subtitles/subtitulamos.png diff --git a/medusa/init/__init__.py b/medusa/init/__init__.py index 1a6309c952..db24e4de7b 100644 --- a/medusa/init/__init__.py +++ b/medusa/init/__init__.py @@ -209,6 +209,7 @@ def _configure_subliminal(): # Register for name in ('napiprojekt = subliminal.providers.napiprojekt:NapiProjektProvider', 'itasa = {basename}.subtitle_providers.itasa:ItaSAProvider'.format(basename=basename), + 'subtitulamos = {basename}.subtitle_providers.subtitulamos:SubtitulamosProvider'.format(basename=basename), 'wizdom = {basename}.subtitle_providers.wizdom:WizdomProvider'.format(basename=basename)): provider_manager.register(name) diff --git a/medusa/subtitle_providers/subtitulamos.py b/medusa/subtitle_providers/subtitulamos.py new file mode 100644 index 0000000000..7114fe6355 --- /dev/null +++ b/medusa/subtitle_providers/subtitulamos.py @@ -0,0 +1,240 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +import logging +import re +import json + +from babelfish import Language, language_converters, LanguageReverseConverter +from guessit import guessit +from requests import Session + +from subliminal.providers import ParserBeautifulSoup, Provider +from subliminal import __short_version__ +from subliminal.cache import EPISODE_EXPIRATION_TIME, region +from subliminal.exceptions import ProviderError +from subliminal.score import get_equivalent_release_groups +from subliminal.subtitle import Subtitle, fix_line_ending, guess_matches +from subliminal.utils import sanitize, sanitize_release_group +from subliminal.video import Episode + +logger = logging.getLogger(__name__) +basename = __name__.split('.')[0] + + +class SubtitulamosConverter(LanguageReverseConverter): + def __init__(self): + self.name_converter = language_converters['name'] + self.from_subtitulamos = {u'Español': ('spa',), u'Español (España)': ('spa',), u'Español (Latinoamérica)': ('spa','MX'), + u'Català': ('cat',), 'English': ('eng',), 'Galego': ('glg',), 'Portuguese': ('por',), + 'English (US)': ('eng', 'US'), 'English (UK)': ('eng', 'GB'), 'Brazilian': ('por', 'BR')} + + self.to_subtitulamos = {('cat',): u'Català', ('glg',): 'Galego', ('por', 'BR'): 'Brazilian'} + + self.codes = set(self.from_subtitulamos.keys()) + + def convert(self, alpha3, country=None, script=None): + if (alpha3, country, script) in self.to_subtitulamos: + return self.to_subtitulamos[[alpha3, country, script]] + if (alpha3, country) in self.to_subtitulamos: + return self.to_subtitulamos[(alpha3, country)] + if (alpha3,) in self.to_subtitulamos: + return self.to_subtitulamos[(alpha3,)] + + return self.name_converter.convert(alpha3, country, script) + + def reverse(self, subtitulamos): + if subtitulamos in self.from_subtitulamos: + return self.from_subtitulamos[subtitulamos] + + return self.name_converter.reverse(subtitulamos) + + +language_converters.register('subtitulamos = {basename}.subtitle_providers.subtitulamos:SubtitulamosConverter'.format(basename=basename)) + + +class SubtitulamosSubtitle(Subtitle): + """Subtitulamos Subtitle.""" + provider_name = 'subtitulamos' + + def __init__(self, language, hearing_impaired, page_link, series, season, episode, title, year, version, + download_link): + super(SubtitulamosSubtitle, self).__init__(language, hearing_impaired, page_link) + self.page_link = page_link + self.series = series + self.season = season + self.episode = episode + self.title = title + self.year = year + self.version = version + self.download_link = download_link + + @property + def id(self): + return self.download_link + + def get_matches(self, video): + matches = set() + + # series name + if video.series and sanitize(self.series) == sanitize(video.series): + matches.add('series') + # season + if video.season and self.season == video.season: + matches.add('season') + # episode + if video.episode and self.episode == video.episode: + matches.add('episode') + # title of the episode + if video.title and sanitize(self.title) == sanitize(video.title): + matches.add('title') + # year + if video.original_series and self.year is None or video.year and video.year == self.year: + matches.add('year') + # release_group + if (video.release_group and self.version and + any(r in sanitize_release_group(self.version) + for r in get_equivalent_release_groups(sanitize_release_group(video.release_group)))): + matches.add('release_group') + # resolution + if video.resolution and self.version and video.resolution in self.version.lower(): + matches.add('resolution') + # other properties + matches |= guess_matches(video, guessit(self.version), partial=True) + + return matches + + +class SubtitulamosProvider(Provider): + """Subtitulamos Provider.""" + languages = {Language('por', 'BR')} | {Language(l) for l in [ + 'cat', 'eng', 'glg', 'por', 'spa' + ]} + video_types = (Episode,) + server_url = 'https://www.subtitulamos.tv/' + search_url = server_url + 'search/query' + + def initialize(self): + self.session = Session() + self.session.headers['User-Agent'] = 'Subliminal/%s' % __short_version__ + + def terminate(self): + self.session.close() + + @region.cache_on_arguments(expiration_time=EPISODE_EXPIRATION_TIME) + def _search_url_titles(self, series, season, episode, year=None): + """Search the URL titles by kind for the given `title`, `season` and `episode`. + + :param str series: series to search for. + :param int season: season to search for. + :param int episode: episode to search for. + :param int year: year to search for. + :return: the episode URL. + :rtype: str + + """ + # make the search + logger.info('%s: Searching episode url for %s, season %d, episode %d', self.__class__.__name__.upper(), series, season, episode) + episode_url = None + + search = '{} {}x{}'.format(series, season, episode) + r = self.session.get(self.search_url, headers={'Referer': self.server_url}, params={'q': search}, timeout=10) + r.raise_for_status() + + if r.status_code != 200: + logger.error('%s: Error getting episode url', self.__class__.__name__.upper()) + raise ProviderError('%s: Error getting episode url', self.__class__.__name__.upper()) + + results = json.loads(r.text) + + for result in results: + title = sanitize(result['name']) + + # attempt series with year + if sanitize('{} ({})'.format(series, year)) in title: + for episode_data in result['episodes']: + if season == episode_data['season'] and episode == episode_data['number']: + episode_url = self.server_url + 'episodes/{}'.format(episode_data['id']) + logger.info('%s: Episode url found with year %s', self.__class__.__name__.upper(), episode_url) + return episode_url + # attempt series without year + elif sanitize(series) in title: + for episode_data in result['episodes']: + if season == episode_data['season'] and episode == episode_data['number']: + episode_url = self.server_url + 'episodes/{}'.format(episode_data['id']) + logger.info('%s: Episode url found without year %s', self.__class__.__name__.upper(), episode_url) + return episode_url + + return episode_url + + def query(self, series, season, episode, year=None): + # get the episode url + episode_url = self._search_url_titles(series, season, episode, year) + if episode_url is None: + logger.warning('%s: No episode url found for %s, season %d, episode %d', self.__class__.__name__.upper(), series, season, episode) + return [] + + r = self.session.get(episode_url, headers={'Referer': self.server_url}, timeout=10) + r.raise_for_status() + soup = ParserBeautifulSoup(r.content, ['lxml', 'html.parser']) + + # get episode title +# title_pattern = re.compile('{}(.+){}x{:02d}- (.+)'.format(series, season, episode).lower()) +# title = title_pattern.search(soup.select('#episode_title')[0].get_text().strip().lower()).group(2) + + +# title_pattern = re.compile('(.+)') +# title = title_pattern.search(soup.select('#episode_title')[0].get_text().strip().lower()).group(1) + + + logger.info('%s: Getting episode title', self.__class__.__name__.upper()) + + title_pattern = re.compile('{}x{:02d} - (.+)'.format(season, episode)) + title = title_pattern.search(soup.select('.episode-name')[0].get_text().strip().lower()).group(1) + + logger.info('%s: Episode title found: "%s"', self.__class__.__name__.upper(), title.upper()) + + subtitles = [] + for sub in soup.find_all('div', attrs={'id': 'progress_buttons_row'}): + # read the language + language = Language.fromsubtitulamos(sub.find_previous('div', class_='subtitle_language').get_text().strip()) + hearing_impaired = False + + # modify spanish latino subtitle language to only spanish and set hearing_impaired = True + # because if exists spanish and spanish latino subtitle for the same episode, the score will be + # higher with spanish subtitle. Spanish subtitle takes priority. + if language == Language('spa', 'MX'): + language = Language('spa') + hearing_impaired = True + + # read the release subtitle + release = sub.find_next('div', class_='version_name').get_text().strip() + + # ignore incomplete subtitles + status = sub.find_next('div', class_='subtitle_buttons').contents[1] + if status.name != 'a': + logger.info('%s: Ignoring subtitle in [%s] not finished', self.__class__.__name__.upper(), language) + continue + + # read the subtitle url + subtitle_url = self.server_url + status['href'][1:] + subtitle = SubtitulamosSubtitle(language, hearing_impaired, episode_url, series, season, episode, title, + year, release, subtitle_url) + logger.info('%s: Found subtitle %r', self.__class__.__name__.upper(), subtitle) + subtitles.append(subtitle) + + return subtitles + + def list_subtitles(self, video, languages): + return [s for s in self.query(video.series, video.season, video.episode, + video.year) + if s.language in languages] + + def download_subtitle(self, subtitle): + # download the subtitle + logger.info('%s: Downloading subtitle %s', self.__class__.__name__.upper(), subtitle.download_link) + r = self.session.get(subtitle.download_link, headers={'Referer': subtitle.page_link}, + timeout=10) + r.raise_for_status() + + subtitle.content = fix_line_ending(r.content) diff --git a/medusa/subtitles.py b/medusa/subtitles.py index 3982091c2f..f131f369ac 100644 --- a/medusa/subtitles.py +++ b/medusa/subtitles.py @@ -69,6 +69,7 @@ 'opensubtitles': 'http://www.opensubtitles.org', 'podnapisi': 'https://www.podnapisi.net', 'shooter': 'http://www.shooter.cn', + 'subtitulamos': 'https://www.subtitulamos.tv', 'thesubdb': 'http://www.thesubdb.com', 'tvsubtitles': 'http://www.tvsubtitles.net', 'wizdom': 'http://wizdom.xyz' diff --git a/tests/test_subtitles.py b/tests/test_subtitles.py index 95f85b0edf..95b6951922 100644 --- a/tests/test_subtitles.py +++ b/tests/test_subtitles.py @@ -35,6 +35,7 @@ def test_sorted_service_list(monkeypatch): {'name': 'napiprojekt', 'enabled': False}, {'name': 'opensubtitles', 'enabled': False}, {'name': 'podnapisi', 'enabled': False}, + {'name': 'subtitulamos', 'enabled': False}, {'name': 'tvsubtitles', 'enabled': False}, {'name': 'wizdom', 'enabled': False}, ] diff --git a/themes-default/slim/static/images/subtitles/subtitulamos.png b/themes-default/slim/static/images/subtitles/subtitulamos.png new file mode 100644 index 0000000000000000000000000000000000000000..ae238042b9397e34d2c4f33a7ce681111fbc9554 GIT binary patch literal 440 zcmV;p0Z0CcP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2jL1E z2LKeq@n}E*00B5jL_t(I%axNoFGNughM#-g?TE-msZmN+6bgmvgpPr{(d`!7rgG43tn=Y3hL6A)kR{HC*Z5TZFb}K)%UMCZXewvj zPGBk*&WCe=#QAUoRQi~{4{QM+04cEBhxpl4Hh}wIiNPf!nm(#hnjV iIdRog5>rWlQGjnyiDF{;ty^CJ0000Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2jL1E z2LKeq@n}E*00B5jL_t(I%axNoFGNughM#-g?TE-msZmN+6bgmvgpPr{(d`!7rgG43tn=Y3hL6A)kR{HC*Z5TZFb}K)%UMCZXewvj zPGBk*&WCe=#QAUoRQi~{4{QM+04cEBhxpl4Hh}wIiNPf!nm(#hnjV iIdRog5>rWlQGjnyiDF{;ty^CJ0000Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2jL1E z2LKeq@n}E*00B5jL_t(I%axNoFGNughM#-g?TE-msZmN+6bgmvgpPr{(d`!7rgG43tn=Y3hL6A)kR{HC*Z5TZFb}K)%UMCZXewvj zPGBk*&WCe=#QAUoRQi~{4{QM+04cEBhxpl4Hh}wIiNPf!nm(#hnjV iIdRog5>rWlQGjnyiDF{;ty^CJ0000 Date: Sat, 21 Dec 2019 18:40:52 +0100 Subject: [PATCH 2/7] Update subtitulamos.py Fix syntax --- medusa/subtitle_providers/subtitulamos.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/medusa/subtitle_providers/subtitulamos.py b/medusa/subtitle_providers/subtitulamos.py index 7114fe6355..4c20c31620 100644 --- a/medusa/subtitle_providers/subtitulamos.py +++ b/medusa/subtitle_providers/subtitulamos.py @@ -1,18 +1,20 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +import json import logging import re -import json -from babelfish import Language, language_converters, LanguageReverseConverter +from babelfish import Language, LanguageReverseConverter, language_converters + from guessit import guessit + from requests import Session -from subliminal.providers import ParserBeautifulSoup, Provider from subliminal import __short_version__ from subliminal.cache import EPISODE_EXPIRATION_TIME, region from subliminal.exceptions import ProviderError +from subliminal.providers import ParserBeautifulSoup, Provider from subliminal.score import get_equivalent_release_groups from subliminal.subtitle import Subtitle, fix_line_ending, guess_matches from subliminal.utils import sanitize, sanitize_release_group @@ -25,7 +27,7 @@ class SubtitulamosConverter(LanguageReverseConverter): def __init__(self): self.name_converter = language_converters['name'] - self.from_subtitulamos = {u'Español': ('spa',), u'Español (España)': ('spa',), u'Español (Latinoamérica)': ('spa','MX'), + self.from_subtitulamos = {u'Español': ('spa',), u'Español (España)': ('spa',), u'Español (Latinoamérica)': ('spa', 'MX'), u'Català': ('cat',), 'English': ('eng',), 'Galego': ('glg',), 'Portuguese': ('por',), 'English (US)': ('eng', 'US'), 'English (UK)': ('eng', 'GB'), 'Brazilian': ('por', 'BR')} @@ -179,14 +181,6 @@ def query(self, series, season, episode, year=None): soup = ParserBeautifulSoup(r.content, ['lxml', 'html.parser']) # get episode title -# title_pattern = re.compile('{}(.+){}x{:02d}- (.+)'.format(series, season, episode).lower()) -# title = title_pattern.search(soup.select('#episode_title')[0].get_text().strip().lower()).group(2) - - -# title_pattern = re.compile('(.+)') -# title = title_pattern.search(soup.select('#episode_title')[0].get_text().strip().lower()).group(1) - - logger.info('%s: Getting episode title', self.__class__.__name__.upper()) title_pattern = re.compile('{}x{:02d} - (.+)'.format(season, episode)) From 8d42fa0e47aa1cc9b08b9a33195013340180516b Mon Sep 17 00:00:00 2001 From: porzino <32703320+porzino@users.noreply.github.com> Date: Mon, 23 Dec 2019 11:16:40 +0100 Subject: [PATCH 3/7] Update setup.cfg Added medusa/subtitle_providers/subtitulamos.py. --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index 640f17a42f..7ae95fbac8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -171,6 +171,7 @@ flake8-ignore = medusa/subtitle_providers/__init__.py D104 medusa/subtitle_providers/legendastv.py D100 D102 D103 D105 D204 medusa/subtitle_providers/itasa.py D100 D101 D102 D105 D400 N813 + medusa/subtitle_providers/subtitulamos.py D100 D101 D102 medusa/subtitle_providers/wizdom.py D100 D102 D204 medusa/system/__init__.py D104 medusa/system/restart.py D100 D101 D102 From d0e619ec53177f346df19ff237455f29a84ad837 Mon Sep 17 00:00:00 2001 From: porzino <32703320+porzino@users.noreply.github.com> Date: Mon, 23 Dec 2019 11:20:37 +0100 Subject: [PATCH 4/7] Update subtitulamos.py Fixed the flake issues D204. --- medusa/subtitle_providers/subtitulamos.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/medusa/subtitle_providers/subtitulamos.py b/medusa/subtitle_providers/subtitulamos.py index 4c20c31620..0ee7d46179 100644 --- a/medusa/subtitle_providers/subtitulamos.py +++ b/medusa/subtitle_providers/subtitulamos.py @@ -57,6 +57,7 @@ def reverse(self, subtitulamos): class SubtitulamosSubtitle(Subtitle): """Subtitulamos Subtitle.""" + provider_name = 'subtitulamos' def __init__(self, language, hearing_impaired, page_link, series, season, episode, title, year, version, @@ -109,6 +110,7 @@ def get_matches(self, video): class SubtitulamosProvider(Provider): """Subtitulamos Provider.""" + languages = {Language('por', 'BR')} | {Language(l) for l in [ 'cat', 'eng', 'glg', 'por', 'spa' ]} From 13d556cc30ff4b6a10c99856bd3979fd1411e0b6 Mon Sep 17 00:00:00 2001 From: porzino <32703320+porzino@users.noreply.github.com> Date: Mon, 23 Dec 2019 11:30:12 +0100 Subject: [PATCH 5/7] Update subtitulamos.py Fixed the flake issues W293. --- medusa/subtitle_providers/subtitulamos.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/medusa/subtitle_providers/subtitulamos.py b/medusa/subtitle_providers/subtitulamos.py index 0ee7d46179..465ebe90c8 100644 --- a/medusa/subtitle_providers/subtitulamos.py +++ b/medusa/subtitle_providers/subtitulamos.py @@ -57,7 +57,7 @@ def reverse(self, subtitulamos): class SubtitulamosSubtitle(Subtitle): """Subtitulamos Subtitle.""" - + provider_name = 'subtitulamos' def __init__(self, language, hearing_impaired, page_link, series, season, episode, title, year, version, @@ -110,7 +110,7 @@ def get_matches(self, video): class SubtitulamosProvider(Provider): """Subtitulamos Provider.""" - + languages = {Language('por', 'BR')} | {Language(l) for l in [ 'cat', 'eng', 'glg', 'por', 'spa' ]} From afcf8d6a0d836247d86a9de2216b7d952f9dbe53 Mon Sep 17 00:00:00 2001 From: porzino <32703320+porzino@users.noreply.github.com> Date: Fri, 3 Jan 2020 14:19:00 +0100 Subject: [PATCH 6/7] Update subtitulamos.py Minor changes made. --- medusa/subtitle_providers/subtitulamos.py | 27 ++++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/medusa/subtitle_providers/subtitulamos.py b/medusa/subtitle_providers/subtitulamos.py index 465ebe90c8..7bafaf4c78 100644 --- a/medusa/subtitle_providers/subtitulamos.py +++ b/medusa/subtitle_providers/subtitulamos.py @@ -138,7 +138,7 @@ def _search_url_titles(self, series, season, episode, year=None): """ # make the search - logger.info('%s: Searching episode url for %s, season %d, episode %d', self.__class__.__name__.upper(), series, season, episode) + logger.info('Searching episode url for %s, season %d, episode %d', series, season, episode) episode_url = None search = '{} {}x{}'.format(series, season, episode) @@ -146,7 +146,7 @@ def _search_url_titles(self, series, season, episode, year=None): r.raise_for_status() if r.status_code != 200: - logger.error('%s: Error getting episode url', self.__class__.__name__.upper()) + logger.warning('Error getting episode url') raise ProviderError('%s: Error getting episode url', self.__class__.__name__.upper()) results = json.loads(r.text) @@ -159,14 +159,14 @@ def _search_url_titles(self, series, season, episode, year=None): for episode_data in result['episodes']: if season == episode_data['season'] and episode == episode_data['number']: episode_url = self.server_url + 'episodes/{}'.format(episode_data['id']) - logger.info('%s: Episode url found with year %s', self.__class__.__name__.upper(), episode_url) + logger.info('Episode url found with year %s', episode_url) return episode_url # attempt series without year elif sanitize(series) in title: for episode_data in result['episodes']: if season == episode_data['season'] and episode == episode_data['number']: episode_url = self.server_url + 'episodes/{}'.format(episode_data['id']) - logger.info('%s: Episode url found without year %s', self.__class__.__name__.upper(), episode_url) + logger.info('Episode url found without year %s', episode_url) return episode_url return episode_url @@ -175,7 +175,7 @@ def query(self, series, season, episode, year=None): # get the episode url episode_url = self._search_url_titles(series, season, episode, year) if episode_url is None: - logger.warning('%s: No episode url found for %s, season %d, episode %d', self.__class__.__name__.upper(), series, season, episode) + logger.info('No episode url found for %s, season %d, episode %d', series, season, episode) return [] r = self.session.get(episode_url, headers={'Referer': self.server_url}, timeout=10) @@ -183,17 +183,17 @@ def query(self, series, season, episode, year=None): soup = ParserBeautifulSoup(r.content, ['lxml', 'html.parser']) # get episode title - logger.info('%s: Getting episode title', self.__class__.__name__.upper()) + logger.debug('Getting episode title') title_pattern = re.compile('{}x{:02d} - (.+)'.format(season, episode)) - title = title_pattern.search(soup.select('.episode-name')[0].get_text().strip().lower()).group(1) + title = title_pattern.search(soup.select('.episode-name')[0].get_text(strip=True).lower()).group(1) - logger.info('%s: Episode title found: "%s"', self.__class__.__name__.upper(), title.upper()) + logger.debug('Episode title found: "%s"', title.upper()) subtitles = [] for sub in soup.find_all('div', attrs={'id': 'progress_buttons_row'}): # read the language - language = Language.fromsubtitulamos(sub.find_previous('div', class_='subtitle_language').get_text().strip()) + language = Language.fromsubtitulamos(sub.find_previous('div', class_='subtitle_language').get_text(strip=True)) hearing_impaired = False # modify spanish latino subtitle language to only spanish and set hearing_impaired = True @@ -204,19 +204,20 @@ def query(self, series, season, episode, year=None): hearing_impaired = True # read the release subtitle - release = sub.find_next('div', class_='version_name').get_text().strip() + release = sub.find_next('div', class_='version_name').get_text(strip=True) # ignore incomplete subtitles status = sub.find_next('div', class_='subtitle_buttons').contents[1] + # if there isn't tag, subtitle not finished and no link available to download it if status.name != 'a': - logger.info('%s: Ignoring subtitle in [%s] not finished', self.__class__.__name__.upper(), language) + logger.info('Ignoring subtitle in [%s] because it is not finished', language) continue # read the subtitle url subtitle_url = self.server_url + status['href'][1:] subtitle = SubtitulamosSubtitle(language, hearing_impaired, episode_url, series, season, episode, title, year, release, subtitle_url) - logger.info('%s: Found subtitle %r', self.__class__.__name__.upper(), subtitle) + logger.info('Found subtitle %r', subtitle) subtitles.append(subtitle) return subtitles @@ -228,7 +229,7 @@ def list_subtitles(self, video, languages): def download_subtitle(self, subtitle): # download the subtitle - logger.info('%s: Downloading subtitle %s', self.__class__.__name__.upper(), subtitle.download_link) + logger.info('Downloading subtitle %s', subtitle.download_link) r = self.session.get(subtitle.download_link, headers={'Referer': subtitle.page_link}, timeout=10) r.raise_for_status() From 398077ce32c8de6729899cf7f0308da549bf9371 Mon Sep 17 00:00:00 2001 From: porzino <32703320+porzino@users.noreply.github.com> Date: Fri, 3 Jan 2020 14:29:20 +0100 Subject: [PATCH 7/7] Update subtitulamos.py Problem with tabs resolved. --- medusa/subtitle_providers/subtitulamos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/medusa/subtitle_providers/subtitulamos.py b/medusa/subtitle_providers/subtitulamos.py index 7bafaf4c78..486066fa8b 100644 --- a/medusa/subtitle_providers/subtitulamos.py +++ b/medusa/subtitle_providers/subtitulamos.py @@ -208,7 +208,7 @@ def query(self, series, season, episode, year=None): # ignore incomplete subtitles status = sub.find_next('div', class_='subtitle_buttons').contents[1] - # if there isn't tag, subtitle not finished and no link available to download it + # if there isn't tag, subtitle not finished and no link available to download it if status.name != 'a': logger.info('Ignoring subtitle in [%s] because it is not finished', language) continue