diff options
author | morpheus65535 <[email protected]> | 2023-12-28 13:17:01 -0500 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2023-12-28 13:17:01 -0500 |
commit | eaa77bd5117aca682106dbbf0e6d92cdb791f031 (patch) | |
tree | 290f0e636833ead57490034dfac934203adc4d5c | |
parent | 7d14798e692710898e94238777897730102bacf4 (diff) | |
download | bazarr-eaa77bd5117aca682106dbbf0e6d92cdb791f031.tar.gz bazarr-eaa77bd5117aca682106dbbf0e6d92cdb791f031.zip |
Fixed zimuku provider protection bypass. #2334
-rw-r--r-- | libs/subliminal_patch/providers/zimuku.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/subliminal_patch/providers/zimuku.py b/libs/subliminal_patch/providers/zimuku.py index c7709e223..7c66bfc6a 100644 --- a/libs/subliminal_patch/providers/zimuku.py +++ b/libs/subliminal_patch/providers/zimuku.py @@ -20,7 +20,7 @@ from subzero.language import Language from guessit import guessit from requests import Session from six import text_type -from random import randint +from random import randint, randrange from python_anticaptcha import AnticaptchaClient, ImageToTextTask from subliminal.providers import ParserBeautifulSoup @@ -109,7 +109,7 @@ class ZimukuProvider(Provider): verify_token = "" code = "" location_re = re.compile( - r'self\.location = "(.*)" \+ stringToHex\(text\)') + r'self\.location = "(.*)" \+ stringToHex\(') verification_image_re = re.compile(r'<img.*?src="data:image/bmp;base64,(.*?)".*?>') def yunsuo_bypass(self, url, *args, **kwargs): @@ -139,7 +139,10 @@ class ZimukuProvider(Provider): # mock js script logic tr = self.location_re.findall(r.text) verification_image = self.verification_image_re.findall(r.text) - self.code = parse_verification_image(verification_image[0]) + if len(verification_image): + self.code = parse_verification_image(verification_image[0]) + else: + self.code = f"{randrange(800, 1920)},{randrange(600, 1080)}" self.session.cookies.set("srcurl", string_to_hex(r.url)) if tr: verify_resp = self.session.get( |