Aternos API ที่ไม่เป็นทางการเขียนใน Python
มันใช้ API ส่วนตัวของ Aternos และการแยกวิเคราะห์ HTML
คำเตือน
ห้องสมุดนี้ไม่ได้รับการดูแลอีกต่อไปเพราะ:
AJAX_TOKEN ซึ่งดำเนินการไม่ถูกต้องใน JS2PY และต้องใช้ไลบรารี NODEJS DOM (อย่างน้อย) หรือเครื่องยนต์เบราว์เซอร์ สำหรับรายละเอียดดู #85ฉันขอโทษ หากคุณต้องการพัฒนา Python-Atternos ต่อไปติดต่อฉัน แต่ฉันคิดว่ามันจะดีกว่าที่จะเขียนตั้งแต่เริ่มต้น
Python Aternos สนับสนุน:
ATERNOS_SESSION$ 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]หากต้องการใช้ Aternos API ในสคริปต์ Python ของคุณนำเข้าและเข้าสู่ระบบด้วยชื่อผู้ใช้และรหัสผ่านหรือแฮช MD5
จากนั้นขอรายชื่อเซิร์ฟเวอร์โดยใช้ list_servers()
คุณสามารถเริ่ม/หยุดเซิร์ฟเวอร์ Aternos ของคุณการเรียก 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 ได้รับการปรับปรุงให้สอดคล้องกับวิธีการรักษาความปลอดภัยใหม่ของ Aternos ขอบคุณมากสำหรับ LUSM554 |
| v0.6/v1.0.0 | การปรับเปลี่ยนรหัส, WebSockets API และการบันทึกเซสชันเพื่อป้องกันการตรวจจับการเข้าถึงระบบอัตโนมัติ |
| v1.0.x | แก้ไขข้อผิดพลาดจำนวนมากการเปลี่ยนเวอร์ชัน (semver) |
| v1.1.x | เอกสาร, การทดสอบหน่วย, pylint, bugfixes, การเปลี่ยนแปลงใน ATWSS |
| v1.1.2/v2.0.0 | โซลูชันสำหรับ #25 (การผ่าน CloudFlare), Bugfixes ใน JS Parser |
| v2.0.x | เอกสารการบันทึก/กู้คืนเซสชันโดยอัตโนมัติการปรับปรุงในไฟล์ API |
| v2.1.x | แก้ไขใน WebSockets API, AtConnect (รวมถึงการแก้ไขการรีเฟรชคุกกี้) สนับสนุนบริการการแก้ปัญหา CAPTCHA (ดู #52) |
| v2.2.x | Node.js การสนับสนุนล่าม |
| v3.0.0 | เขียนใหม่บางส่วนอัปเดต API |
| v3.0.5 | ไม่มีการบำรุงรักษา |
| v3.1.x | TODO: การใช้งานอย่างเต็มรูปแบบของ CONFIC API |
| v3.2.x | TODO: การเข้าถึง API Access ที่ใช้ร่วมกันและอาจเป็นการสำรองข้อมูล Google Drive |
คำขอส่วนตัว ATERNOS API ถูกจับเข้าไปในไฟล์ HAR นี้และนำเข้าสู่พื้นที่ทำงานของบุรุษไปรษณีย์
คุณสามารถใช้ทรัพยากรทั้งสองเพื่อสำรวจ 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.