baidu-reporter/app/utils/ydm_verify.py

20 lines
574 B
Python
Raw Normal View History

2025-03-30 22:49:37 +08:00
import base64
import json
import requests
class YdmVerify(object):
_custom_url = "https://www.jfbym.com/api/YmServer/customApi"
_token = "HhUGwpI6AtQGoux36i1ZpsDv7hwGSbr1hQ0RX-HXSZE"
_headers = {
'Content-Type': 'application/json'
}
def rotate(self, image):
payload = {
"image": base64.b64encode(image).decode(),
"token": self._token,
"type": "90009"
}
resp = requests.post(self._custom_url, headers=self._headers, data=json.dumps(payload))
return resp.json()['data']['data']