jozhn / ddmc.monitor Goto Github PK
View Code? Open in Web Editor NEW叮咚买菜 运力监控
License: Apache License 2.0
叮咚买菜 运力监控
License: Apache License 2.0
def check_home():
url = 'https://maicai.api.ddxq.mobi/homeApi/newDetails'
payload = {'api_version': '9.49.1',
'station_id': config.station_id,
}
r = requests.get(url, params=payload)
返回<Response [405]>怎么解决
代码报错在这里json load的时候
with open("all_categories_formatted.json") as f:
flag = False
all_categories = json.load(f)
错误信息如下
UnicodeDecodeError: 'gbk' codec can't decode byte 0x9c in position 38: illegal multibyte sequence
感觉是商品列表的json有问题,但是我查了一下json格式是没有问题的。
PS:购物车监控运力运行良好 谢谢大大啦。
{'success': False, 'code': 1, 'msg': '参数错误', 'data': [], 'tradeTag': 'success', 'server_time': 1649842991, 'is_trade': 1}
请求异常!
执行main.py后check_stock报错:
Traceback (most recent call last):
File "D:\1\main.py", line 94, in
run()
File "D:\1\main.py", line 84, in run
check_stock()
File "D:\1\check_stock.py", line 117, in check_stock
if len(menu['products']) > 0:
TypeError: 'NoneType' object is not subscriptable
我不懂python,只是为了抢菜。我是用iphone连mac charles
先根据charles抓包内容,配置了config.py。
pip3 install requests
后,出现下面这些,我也不知道算安装成功了没有:
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Requirement already satisfied: requests in /usr/local/lib/python3.9/site-packages (2.25.1)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.9/site-packages (from requests) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/site-packages (from requests) (2020.12.5)
Requirement already satisfied: chardet<5,>=3.0.2 in /usr/local/lib/python3.9/site-packages (from requests) (4.0.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/site-packages (from requests) (1.26.4)
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
运行python3 main.py
,等了好几秒后,出现这个错误:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 445, in _make_request
six.raise_from(e, None)
File "<string>", line 3, in raise_from
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 440, in _make_request
httplib_response = conn.getresponse()
File "/usr/local/Cellar/[email protected]/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1377, in getresponse
response.begin()
File "/usr/local/Cellar/[email protected]/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 320, in begin
version, status, reason = self._read_status()
File "/usr/local/Cellar/[email protected]/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 289, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.9/site-packages/urllib3/util/retry.py", line 532, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/local/lib/python3.9/site-packages/urllib3/packages/six.py", line 734, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 445, in _make_request
six.raise_from(e, None)
File "<string>", line 3, in raise_from
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 440, in _make_request
httplib_response = conn.getresponse()
File "/usr/local/Cellar/[email protected]/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1377, in getresponse
response.begin()
File "/usr/local/Cellar/[email protected]/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 320, in begin
version, status, reason = self._read_status()
File "/usr/local/Cellar/[email protected]/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 289, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/ddbbdd/ddmc.monitor/main.py", line 94, in <module>
run()
File "/Users/ddbbdd/ddmc.monitor/main.py", line 82, in run
check_cart()
File "/Users/ddbbdd/ddmc.monitor/main.py", line 56, in check_cart
r = requests.post(url, headers=headers, data=raw)
File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 119, in post
return request('post', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
不知道哪里配置不对?谢谢
老大好,没有ios设备,bark研究了半天支持不了
接口都查不到是改成ws了吗?带上session直接堵死,是改成websocket了吗?
这个参数能给个样例不
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.day.app', port=443): Max retries exceeded with url:
import urllib3
urllib3.disable_warnings()
pip install cryptography
pip install pyOpenSSL
pip install certifi
verify=False
{'success': False, 'code': 1, 'msg': '参数错误', 'data': [], 'tradeTag': 'success', 'server_time': 1650513103, 'is_trade': 1}
请求异常!
请问怎么查看站点id啊?
求助,raw_body该怎么传,我直接把get请求?后面的字符串传进去报参数错误
想问一下bark id是填service页面的很长一串地址还是填settings里的github run id?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.