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.