aboutsummaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2023-12-28 13:17:01 -0500
committermorpheus65535 <[email protected]>2023-12-28 13:17:01 -0500
commiteaa77bd5117aca682106dbbf0e6d92cdb791f031 (patch)
tree290f0e636833ead57490034dfac934203adc4d5c /libs
parent7d14798e692710898e94238777897730102bacf4 (diff)
downloadbazarr-eaa77bd5117aca682106dbbf0e6d92cdb791f031.tar.gz
bazarr-eaa77bd5117aca682106dbbf0e6d92cdb791f031.zip
Fixed zimuku provider protection bypass. #2334
Diffstat (limited to 'libs')
-rw-r--r--libs/subliminal_patch/providers/zimuku.py9
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(