Skip to content

Commit

Permalink
Fixed zimuku.org parsing error
Browse files Browse the repository at this point in the history
  • Loading branch information
kfstorm committed May 7, 2023
1 parent e83f37d commit 0907269
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/subliminal_patch/providers/zimuku.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def bmp_to_image(base64_str, img_type='png'):
self.session.cookies.set("srcurl", string_to_hex(r.url))
if tr:
verify_resp = self.session.get(
self.server_url + tr[0] + string_to_hex(self.code), allow_redirects=False)
urljoin(self.server_url, tr[0] + string_to_hex(self.code)), allow_redirects=False)
if verify_resp.status_code == 302 \
and self.session.cookies.get("security_session_verify") is not None:
pass
Expand All @@ -164,7 +164,7 @@ def _parse_episode_page(self, link, year):
bs_obj = ParserBeautifulSoup(
r.content.decode("utf-8", "ignore"), ["html.parser"]
)
subs_body = bs_obj.find("div", class_="subs box clearfix").find("tbody")
subs_body = bs_obj.find("tbody")
subs = []
for sub in subs_body.find_all("tr"):
a = sub.find("a")
Expand Down Expand Up @@ -208,7 +208,7 @@ def query(self, keyword, season=None, episode=None, year=None):

logger.debug("Searching subtitles %r", params)
subtitles = []
search_link = self.server_url + text_type(self.search_url).format(params)
search_link = urljoin(self.server_url, text_type(self.search_url).format(params))

r = self.yunsuo_bypass(search_link, timeout=30)
r.raise_for_status()
Expand Down Expand Up @@ -254,7 +254,7 @@ def query(self, keyword, season=None, episode=None, year=None):
season_cn2 = num_to_cn(str(season))
if season_cn1 != season_cn2:
continue
episode_link = self.server_url + title_a.attrs["href"]
episode_link = urljoin(self.server_url, title_a.attrs["href"])
new_subs = self._parse_episode_page(episode_link, subs_year)
subtitles += new_subs

Expand Down

0 comments on commit 0907269

Please sign in to comment.