derkalle4 / python3-idotmatrix-client

reverse engineered python3 client to control all your 16x16 or 32x32 pixel displays (experimental)
GNU General Public License v3.0
162 stars 34 forks source link

Helping About Cloud API Materials #28

Open eyups opened 5 months ago

eyups commented 5 months ago

First thanks for this great project. I can't wait integrate this to my HomeAssistant and manage it from there 👯

I have tried to get information about getting cloud data from the application itself. It seems it is quite easy as the API doesn't require any kind of authentication mechanism. So direct requests to the API will be supported. As I can't have enough time to help in coding stuff I just wanted to help you achieve this.

Getting Cloud Animations - Materials

type

category_name

Request

import requests

eyup0_url = "https://api.e-toys.cn:443/api/ResourceApp/getMaterialUnderCategory"
eyup0_headers = {"Content-Type": "application/json; charset=utf-8", "Accept-Encoding": "gzip, deflate, br", "User-Agent": "okhttp/5.0.0-alpha.2", "Connection": "close"}

eyup0_json={
    "appid": "140", 
    "category_name": "\xe6\x97\xa5\xe5\xb8\xb8_IDM", 
    "count": 10, 
    "height": 32, 
    "label": "ALL", 
    "page": 1, 
    "sort": "1", 
    "type": "\xe5\x8a\xa8\xe7\x94\xbb", 
    "width": 32
}

requests.post(eyup0_url, headers=eyup0_headers, json=eyup0_json)

Response

{
  "status": 0,
  "msg": "成功",
  "data": {
    "totalCount": 199,
    "totalPage": 20,
    "pageNo": 1,
    "pageSize": 10,
    "records": [
      {
        "app_id": "140",
        "category_id": "7",
        "category_name": "日常_IDM",
        "file_path": "http://api.e-toys.cn/resources/upload/20230809/animation_1_32x32_1.gif",
        "format": "gif",
        "height": "32",
        "label": "ALL",
        "sort": "667",
        "type": "动画",
        "width": "32"
      } ... [REDACTED]
    ]
  }
}

Getting Firmware Information

Request

import requests

eyup0_url = "https://api.e-toys.cn:443/api/ResourceApp/getFirmwareInfo"
eyup0_headers = {"Content-Type": "application/x-www-form-urlencoded", "Accept-Encoding": "gzip, deflate, br", "User-Agent": "okhttp/5.0.0-alpha.2", "Connection": "close"}
eyup0_data = {"appid": "140", "project_no": "TR2023-4-000104", "version": "411"}
requests.post(eyup0_url, headers=eyup0_headers, data=eyup0_data)

Response

{
  "status": 0,
  "msg": "成功",
  "data": {
    "app_id": "140",
    "desc_cn": "修改了已知的问题.",
    "desc_en": "Fixes known problems.",
    "file_path": "http://api.e-toys.cn/resources/upload/firmware/140/411/TR2306R007(4.11-000104).ufw",
    "force": false,
    "need_update": false,
    "version_no": "411"
  }
}
derkalle4 commented 5 months ago

Hi @eyups

Wow, many thanks for your help:) looks promising! Soon I will have the iDotMatrix Library ready and implement your findings there.

You can start ahead and already use this library in your own projects, should be way easier then using this client.

Please give me some days to optimize that library and add it to pypi property:)

https://github.com/derkalle4/python3-idotmatrix-library

I'll let you know once I have implemented your findings.

Kind regards, Kalle

aviwad commented 1 week ago

Hi. Do you have any more details on getting the Cloud API working?

eyups commented 1 week ago

Hi please give details about the details you want :)