aioqzone 1.3.0.dev2__tar.gz → 1.3.1.dev3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/PKG-INFO +1 -1
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/pyproject.toml +1 -1
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/api/h5/raw.py +15 -12
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/up/web.py +7 -5
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/LICENSE +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/README.md +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/__init__.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/api/__init__.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/api/h5/__init__.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/api/h5/model.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/api/login/__init__.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/api/login/_base.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/exception.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/message.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/model/__init__.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/model/protocol/__init__.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/model/protocol/config.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/model/protocol/entity.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/model/response/__init__.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/model/response/h5.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/utils/__init__.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/utils/entity.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/utils/regex.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/utils/retry.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/aioqzone/utils/time.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/__init__.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/base.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/constant.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/exception.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/message.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/py.typed +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/qr/__init__.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/qr/type.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/type.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/up/__init__.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/up/_model.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/up/captcha/__init__.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/up/captcha/jigsaw.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/up/encrypt.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/up/h5.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/utils/encrypt.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/utils/iter.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/utils/jsjson.py +0 -0
- {aioqzone-1.3.0.dev2 → aioqzone-1.3.1.dev3}/src/qqqr/utils/net.py +0 -0
|
@@ -157,19 +157,22 @@ class QzoneH5RawAPI:
|
|
|
157
157
|
async def retry_closure():
|
|
158
158
|
async with self.host_get("/mqzone/index", attach_token=False) as r:
|
|
159
159
|
r.raise_for_status()
|
|
160
|
-
return await r.text()
|
|
161
|
-
|
|
162
|
-
html = await retry_closure()
|
|
163
|
-
scripts: List = fromstring(html).xpath('body/script[@type="application/javascript"]')
|
|
164
|
-
if not scripts:
|
|
165
|
-
log.debug(html)
|
|
166
|
-
raise RuntimeError("script tag not found")
|
|
167
|
-
|
|
168
|
-
texts: List[str] = [s.text for s in scripts]
|
|
169
|
-
script = firstn(texts, lambda s: "shine0callback" in s)
|
|
170
|
-
if not script:
|
|
171
|
-
raise RuntimeError("data script not found")
|
|
172
160
|
|
|
161
|
+
html = await r.text()
|
|
162
|
+
scripts: List = fromstring(html).xpath(
|
|
163
|
+
'body/script[@type="application/javascript"]'
|
|
164
|
+
)
|
|
165
|
+
if not scripts:
|
|
166
|
+
log.debug("jump to %s", str(r.url))
|
|
167
|
+
raise QzoneError(-3000, "script tag not found")
|
|
168
|
+
|
|
169
|
+
texts: List[str] = [s.text for s in scripts]
|
|
170
|
+
script = firstn(texts, lambda s: "shine0callback" in s)
|
|
171
|
+
if not script:
|
|
172
|
+
raise QzoneError(-3000, "data script not found")
|
|
173
|
+
return script
|
|
174
|
+
|
|
175
|
+
script = await retry_closure()
|
|
173
176
|
m = re.search(r'window\.shine0callback.*return "([0-9a-f]+?)";', script)
|
|
174
177
|
if m is None:
|
|
175
178
|
raise RuntimeError("data script not found")
|
|
@@ -254,7 +254,11 @@ class UpWebLogin(_UpHookMixin, LoginBase[UpWebSession]):
|
|
|
254
254
|
|
|
255
255
|
if sess.code == StatusCode.NeedCaptcha:
|
|
256
256
|
log.warning("需通过防水墙")
|
|
257
|
-
|
|
257
|
+
try:
|
|
258
|
+
sess = await self.pass_vc(sess)
|
|
259
|
+
except NotImplementedError:
|
|
260
|
+
raise TencentLoginError(StatusCode.NeedCaptcha, "非滑动验证码,无法自动通过")
|
|
261
|
+
if sess is None:
|
|
258
262
|
raise TencentLoginError(StatusCode.NeedCaptcha, "未安装依赖,无法识别验证码")
|
|
259
263
|
if sess.verify_rst is None or not sess.verify_rst.ticket:
|
|
260
264
|
raise TencentLoginError(StatusCode.NeedCaptcha, "验证过程出现错误")
|
|
@@ -311,6 +315,7 @@ class UpWebLogin(_UpHookMixin, LoginBase[UpWebSession]):
|
|
|
311
315
|
It is called when :meth:`.try_login` returns a :obj:`StatusCode.NeedCaptcha` code.
|
|
312
316
|
|
|
313
317
|
:param sess: the session object
|
|
318
|
+
:raise NotImplementedError: if not a slide captcha
|
|
314
319
|
:return: The session with :obj:`~UpWebSession.verify_rst` is set, or None if :exc:`ImportError`.
|
|
315
320
|
"""
|
|
316
321
|
solver = self.captcha(sess.check_rst.session)
|
|
@@ -318,10 +323,7 @@ class UpWebLogin(_UpHookMixin, LoginBase[UpWebSession]):
|
|
|
318
323
|
return
|
|
319
324
|
|
|
320
325
|
for retry in range(4):
|
|
321
|
-
|
|
322
|
-
sess.verify_rst = await solver.verify()
|
|
323
|
-
except NotImplementedError:
|
|
324
|
-
return
|
|
326
|
+
sess.verify_rst = await solver.verify()
|
|
325
327
|
if sess.verify_rst.ticket:
|
|
326
328
|
break
|
|
327
329
|
log.warning(f"ticket is empty. retry={retry}")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|