一、云打码平台使用
- 官网url:http://www.yundama.com/demo.html
- 注册:
- 普通用户
- 开发者用户
- 登录平台
- 普通用户 - 查询余额(题分)
- 开发者用户 - 创建一个软件,软件的id和通讯密钥后期在编码时会被用到
- 开发文档,下载最新的DLL文档,pythonHTTP
- 编码
二、编码
import requests
import json
import time
class YDMHttp:
apiurl = 'http://api.yundama.com/api.php'
username = ''
password = ''
appid = ''
appkey = ''
def __init__(self, username, password, appid, appkey):
self.username = username
self.password = password
self.appid = str(appid)
self.appkey = appkey
def request(self, fields, files=[]):
response = self.post_url(self.apiurl, fields, files)
response = json.loads(response)
return response
def balance(self):
data = {'method': 'balance', 'username': self.username, 'password': self.password, 'appid': self.appid, 'appkey': self.appkey}
response = self.request(data)
if (response):
if (response['ret'] and response['ret'] < 0):
return response['ret']
else:
return response['balance