python aternos
v2.0.1
用python编写的非官方的Anternos API。
它使用Anternos的私人API和HTML解析。
警告
该库不再维护,因为:
AJAX_TOKEN中的JS代码检测所有自动请求(因此,违反TOS违规),该请求在JS2PY中不正确地执行,并且需要Nodejs DOM库(至少)或浏览器引擎。有关详细信息,请参见#85。我很抱歉。如果您想继续开发Python-atrenos,请与我联系,但我认为最好从头开始写作。
Python Anternos支持:
ATERNOS_SESSION cookie值$ pip install python-aternos注意Windows用户
如果您有问题,请从此处安装
lxml软件包,然后执行:
pip install --no-deps python-aternos
$ git clone https://github.com/DarkCat09/python-aternos.git
$ cd python-aternos
$ pip install -e .[dev]要在Python脚本中使用Aternos API,请使用您的用户名和密码或其MD5哈希进行导入并登录。
然后使用list_servers()请求服务器列表。
您可以启动/停止Anternos服务器,调用start()或stop() 。
这是如何使用API的示例:
# Import
from python_aternos import Client
# Create object
atclient = Client ()
# Log in
# with username and password
atclient . login ( 'example' , 'test123' )
# ----OR----
# with username and MD5 hashed password
atclient . login_hashed ( 'example' , 'cc03e747a6afbbcbf8be7668acfebee5' )
# ----OR----
# with session cookie
atclient . login_with_session ( 'ATERNOS_SESSION cookie value' )
# Get AternosAccount object
aternos = atclient . account
# Get servers list
servs = aternos . list_servers ()
# Get the first server
myserv = servs [ 0 ]
# Start
myserv . start ()
# Stop
myserv . stop ()
# You can also find server by IP
testserv = None
for serv in servs :
if serv . address == 'test.aternos.org' :
testserv = serv
if testserv is not None :
# Prints the server software and its version
# (for example, "Vanilla 1.12.2")
print ( testserv . software , testserv . version )
# Starts server
testserv . start ()| 版本 | 描述 |
|---|---|
| v0.3 | 实现的文件API,添加了类型。 |
| v0.4 | 实现的配置API,一些错误文件。 |
| v0.5 | API已更新,对应于新的Anteros安全方法。非常感谢LUSM554。 |
| v0.6/v1.0.0 | 代码重构,Websockets API和会话节省,以防止检测自动化访问。 |
| v1.0.x | 许多错误相装,更改版本控制(SEMVER)。 |
| v1.1.x | 文档,单位测试,孔,错误文件,ATWSS的更改。 |
| v1.1.2/v2.0.0 | #25的解决方案(CloudFlare绕过),JS解析器中的错误缀合物。 |
| v2.0.x | 文档,自动保存/还原会话,文件API的改进。 |
| v2.1.x | 修复Websockets API,ATCONNECT(包括Cookie Refreshing Fix)。支持验证验解决服务(查看#52)。 |
| v2.2.x | Node.js解释器支持。 |
| v3.0.0 | 部分重写,API更新。 |
| v3.0.5 | 不受欢迎。 |
| v3.1.x | TODO:配置API的完整实现。 |
| v3.2.x | TODO:共享访问API,也许是Google Drive备份。 |
私人Aternos API请求被捕获到此HAR文件中,并进口到Postman工作区。
您可以使用这两个资源来探索API。
欢迎改善此图书馆的任何帮助。
许可通知:
Copyright 2021-2022 All contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.