mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-23 08:13:14 +00:00
Fix Missing subtitles issue with Ktuvit provider
This commit is contained in:
parent
c1421f1cce
commit
66585ec765
1 changed files with 12 additions and 4 deletions
|
@ -118,6 +118,7 @@ class KtuvitProvider(Provider):
|
|||
request_download_id_url = "Services/ContentProvider.svc/RequestSubtitleDownload"
|
||||
download_link = "Services/DownloadFile.ashx?DownloadIdentifier="
|
||||
subtitle_class = KtuvitSubtitle
|
||||
no_subtitle_str = 'אין כתוביות'
|
||||
|
||||
_tmdb_api_key = "a51ee051bcd762543373903de296e0a3"
|
||||
|
||||
|
@ -315,6 +316,7 @@ class KtuvitProvider(Provider):
|
|||
else:
|
||||
subs = self._search_tvshow(ktuvit_id, season, episode)
|
||||
|
||||
logger.debug('Got {} Subs from Ktuvit'.format(len(subs)))
|
||||
for sub in subs:
|
||||
# otherwise create it
|
||||
subtitle = KtuvitSubtitle(
|
||||
|
@ -349,7 +351,11 @@ class KtuvitProvider(Provider):
|
|||
r.raise_for_status()
|
||||
|
||||
sub_list = ParserBeautifulSoup(r.content, ["html.parser"])
|
||||
sub_rows = sub_list.find_all("tr")
|
||||
sub_rows = sub_list("tr")
|
||||
|
||||
if sub_list.find("tr") and sub_list.find("tr").find("td") and sub_list.find("tr").find("td").get_text() == self.no_subtitle_str:
|
||||
logger.debug("No Subtitles Found. URL " + url)
|
||||
return subs
|
||||
|
||||
for row in sub_rows:
|
||||
columns = row.find_all("td")
|
||||
|
@ -362,8 +368,9 @@ class KtuvitProvider(Provider):
|
|||
sub["sub_id"] = column.find("input", attrs={"data-sub-id": True})[
|
||||
"data-sub-id"
|
||||
]
|
||||
|
||||
subs.append(sub)
|
||||
|
||||
if 'sub_id' in sub:
|
||||
subs.append(sub)
|
||||
return subs
|
||||
|
||||
def _search_movie(self, movie_id):
|
||||
|
@ -386,7 +393,8 @@ class KtuvitProvider(Provider):
|
|||
"data-subtitle-id"
|
||||
]
|
||||
|
||||
subs.append(sub)
|
||||
if 'sub_id' in sub:
|
||||
subs.append(sub)
|
||||
return subs
|
||||
|
||||
def list_subtitles(self, video, languages):
|
||||
|
|
Loading…
Reference in a new issue