【已解决】宝塔面板api python示例还能用吗?
python bt.pyTraceback (most recent call last):
File "/home/wangxiao/bt.py", line 107, in <module>
r_data = my_api.get_logs()
^^^^^^^^^^^^^^^^^
File "/home/wangxiao/bt.py", line 37, in get_logs
result = self.__http_post_cookie(url,p_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/wangxiao/bt.py", line 90, in __http_post_cookie
cookie_obj.load(cookie_file,ignore_discard=True,ignore_expires=True)
File "/usr/lib/python3.12/http/cookiejar.py", line 1801, in load
with open(filename) as f:
^^^^^^^^^^^^^^
FileNotFoundError: No such file or directory: './cd1e85cc257202dc6eb4f3e37efd7fa5.cookie'
只修改了这两个api信息,其他的都没有动,运行直接报错
__BT_KEY = '4vKENa5oEo8ZoNBuN7Rt6QGtlgB0Bo5i'
__BT_PANEL = 'http://192.168.1.245:8888'
————————————————已经解决了,示例代码是老的python2,与python3有部分不兼容
页:
[1]