mirror of
https://github.com/morpheus65535/bazarr.git
synced 2024-11-10 09:02:44 +08:00
no log: some pep8 fixes to legendasnet
This commit is contained in:
parent
b8aa2a8b1a
commit
42781d5b68
1 changed files with 32 additions and 30 deletions
|
@ -131,30 +131,30 @@ class LegendasNetProvider(ProviderRetryMixin, Provider):
|
||||||
if isinstance(self.video, Episode):
|
if isinstance(self.video, Episode):
|
||||||
res = self.retry(
|
res = self.retry(
|
||||||
lambda: self.session.get(self.server_url() + 'search/tv',
|
lambda: self.session.get(self.server_url() + 'search/tv',
|
||||||
json={
|
json={
|
||||||
'name': video.series,
|
'name': video.series,
|
||||||
'page': 1,
|
'page': 1,
|
||||||
'per_page': 25,
|
'per_page': 25,
|
||||||
'tv_episode': video.episode,
|
'tv_episode': video.episode,
|
||||||
'tv_season': video.season,
|
'tv_season': video.season,
|
||||||
'imdb_id': video.series_imdb_id
|
'imdb_id': video.series_imdb_id
|
||||||
},
|
},
|
||||||
headers={'Content-Type': 'application/json'},
|
headers={'Content-Type': 'application/json'},
|
||||||
timeout=30),
|
timeout=30),
|
||||||
amount=retry_amount,
|
amount=retry_amount,
|
||||||
retry_timeout=retry_timeout
|
retry_timeout=retry_timeout
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
res = self.retry(
|
res = self.retry(
|
||||||
lambda: self.session.get(self.server_url() + 'search/movie',
|
lambda: self.session.get(self.server_url() + 'search/movie',
|
||||||
json={
|
json={
|
||||||
'name': video.title,
|
'name': video.title,
|
||||||
'page': 1,
|
'page': 1,
|
||||||
'per_page': 25,
|
'per_page': 25,
|
||||||
'imdb_id': video.imdb_id
|
'imdb_id': video.imdb_id
|
||||||
},
|
},
|
||||||
headers={'Content-Type': 'application/json'},
|
headers={'Content-Type': 'application/json'},
|
||||||
timeout=30),
|
timeout=30),
|
||||||
amount=retry_amount,
|
amount=retry_amount,
|
||||||
retry_timeout=retry_timeout
|
retry_timeout=retry_timeout
|
||||||
)
|
)
|
||||||
|
@ -183,8 +183,9 @@ class LegendasNetProvider(ProviderRetryMixin, Provider):
|
||||||
subtitle = LegendasNetSubtitle(
|
subtitle = LegendasNetSubtitle(
|
||||||
language=Language('por', 'BR'),
|
language=Language('por', 'BR'),
|
||||||
forced=self._is_forced(item),
|
forced=self._is_forced(item),
|
||||||
page_link= f"https://legendas.net/tv_legenda?movie_id={result['tv_shows'][0]['tmdb_id']}&legenda_id={item['id']}",
|
page_link=f"https://legendas.net/tv_legenda?movie_id={result['tv_shows'][0]['tmdb_id']}&"
|
||||||
download_link= item['path'],
|
f"legenda_id={item['id']}",
|
||||||
|
download_link=item['path'],
|
||||||
file_id=item['id'],
|
file_id=item['id'],
|
||||||
release_names=[item.get('release_name', '')],
|
release_names=[item.get('release_name', '')],
|
||||||
uploader=item['uploader'],
|
uploader=item['uploader'],
|
||||||
|
@ -200,8 +201,9 @@ class LegendasNetProvider(ProviderRetryMixin, Provider):
|
||||||
subtitle = LegendasNetSubtitle(
|
subtitle = LegendasNetSubtitle(
|
||||||
language=Language('por', 'BR'),
|
language=Language('por', 'BR'),
|
||||||
forced=self._is_forced(item),
|
forced=self._is_forced(item),
|
||||||
page_link= f"https://legendas.net/legenda?movie_id={result['movies'][0]['tmdb_id']}&legenda_id={item['id']}",
|
page_link=f"https://legendas.net/legenda?movie_id={result['movies'][0]['tmdb_id']}&"
|
||||||
download_link= item['path'],
|
f"legenda_id={item['id']}",
|
||||||
|
download_link=item['path'],
|
||||||
file_id=item['id'],
|
file_id=item['id'],
|
||||||
release_names=[item.get('release_name', '')],
|
release_names=[item.get('release_name', '')],
|
||||||
uploader=item['uploader'],
|
uploader=item['uploader'],
|
||||||
|
@ -229,7 +231,7 @@ class LegendasNetProvider(ProviderRetryMixin, Provider):
|
||||||
|
|
||||||
def download_subtitle(self, subtitle):
|
def download_subtitle(self, subtitle):
|
||||||
logger.debug('Downloading subtitle %r', subtitle)
|
logger.debug('Downloading subtitle %r', subtitle)
|
||||||
download_link = urljoin("https://legendas.net",subtitle.download_link)
|
download_link = urljoin("https://legendas.net", subtitle.download_link)
|
||||||
|
|
||||||
r = self.retry(
|
r = self.retry(
|
||||||
lambda: self.session.get(download_link, timeout=30),
|
lambda: self.session.get(download_link, timeout=30),
|
||||||
|
|
Loading…
Reference in a new issue