Skip to content

Commit

Permalink
fix #22
Browse files Browse the repository at this point in the history
  • Loading branch information
vypivshiy committed Jun 28, 2023
1 parent 0b39541 commit 53ad2a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion anicli_ru/kodik.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ def char_wrapper(e):
base64_url = re.sub(r"[a-zA-Z]", char_wrapper, url_encoded)
if not base64_url.endswith("=="):
base64_url += "=="
return f"https:{b64decode(base64_url).decode()}"
decoded_url = b64decode(base64_url).decode()
if decoded_url.startswith("https:"):
return decoded_url
return f"https:{decoded_url}"

@staticmethod
def is_kodik(url: str) -> bool:
Expand Down

0 comments on commit 53ad2a4

Please sign in to comment.