Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

正常运行中突然报错,这个是啥情况 #23

Closed
glimjoe opened this issue Dec 15, 2022 · 5 comments
Closed

正常运行中突然报错,这个是啥情况 #23

glimjoe opened this issue Dec 15, 2022 · 5 comments

Comments

@glimjoe
Copy link

glimjoe commented Dec 15, 2022

2022-12-15 09:03:16,482 INFO: 登录成功
Traceback (most recent call last):
File "C:\Users~\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users~\AppData\Local\Programs\Python\Python310\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users~\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users~\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\temp\JdBuyer-main\JdBuyer.py", line 115, in
buyer.buyItemInStock(skuId, areaId, skuNum, stockInterval,
File "C:\temp\JdBuyer-main\JdBuyer.py", line 76, in buyItemInStock
self.session.fetchItemDetail(skuId)
File "C:\temp\JdBuyer-main\JdSession.py", line 169, in fetchItemDetail
resp = self.getItemDetail(skuId).json()
File "C:\Users~\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

尝试打印getItemDetail方法中调用京东接口的返回值,发现是{'code': 200,'limit': 1}

@anysoft
Copy link

anysoft commented Dec 15, 2022

被限制访问了。应该是账号被限了。因为一直调用接口频率过高,所以对账号进行限制了。至于多久能解封,这个就不好说了。
正确用法是短时间内刷5秒的库存查询间隔还好,如果要长时间挂机刷,那么库存频率得提升到15~30s左右。

@glimjoe
Copy link
Author

glimjoe commented Dec 15, 2022

被限制访问了。应该是账号被限了。因为一直调用接口频率过高,所以对账号进行限制了。至于多久能解封,这个就不好说了。 正确用法是短时间内刷5秒的库存查询间隔还好,如果要长时间挂机刷,那么库存频率得提升到15~30s左右。

麻了,我开的2秒一次。。。那我等解封改到20秒好了

@asd8855
Copy link

asd8855 commented Dec 16, 2022

换个IP,后者wifi切换成热点就好了

@WGwangguan
Copy link

换了 ip 也不得行了

@anysoft
Copy link

anysoft commented Apr 18, 2023

换了 ip 也不得行了

封的账号,别频繁请求,对jd来说算恶意请求的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants