Sign in/Sign upUser centerRemaining:0Recent taskInviteLog outLanguage简体中文English日本语EspañolFrancésAPIPriceHili PhotoEnhance is a photo repair and retouching tool, that uses AI algorithms to automatically colorize black& white photos, repair old photos, and optimize blurred out-of-focus photos.
About Us
Founded in 2019, Beijing Hanliang Technology Co., Ltd. is a startup company composed of senior practitioners in the OTT and IPTV video industries. It is committed to applying artificial intelligence and computer vision technologies to the field of video/image processing.We provide customers with a variety of customizable image and video processing solutions.
The word "HanLiang" means sweat and grain.
Contact number: 010-5335 5193
QQ group: 623946846
Email: wearebug&gmail.com
PriceAPI
3 photo = ¥49.8Expiry:one yearPrioritize:YESSize:6000pxOld repair:YESBatch:NOWechatRebate
10 photos = ¥150Expiry:one yearPrioritize:YESSize:6000pxOld repair:YESBatch:YESWechatRebate
50 photos = ¥400Expiry:one yearPrioritize:YESSize:6000pxOld repair:YESBatch:YESWechatRebate
200 photos = ¥1000Expiry:one yearPrioritize:YESSize:6000pxOld repair:YESBatch:YESWechatRebate
For lower prices, please join the QQ group (623946846) for consultation
准备
1、线下付款,获取可上传图片次数
2、申请请求接口所需的third_code和secret_key
3、根据接口文档,接入服务
说明
1、按照图片上传次数扣费,上传失败不扣费
2、获取到的secret_key请妥善保管,不可外传
3、所有修复成功的图片本站将保留1小时后自动删除,如需持久化存储请下载至自有系统
接口说明
1、请求地址: http://sdkphoto.fangtangtv.com
2、code=200固定为成功,code=9000固定为失败
3、code=9000时,如需进一步业务判断,可根据errno参数
1、图片上传接口
URL /api/third/uploads
Method POST
Header token: 加密生成的token,加密规则见附1
Params
field	type	required	commit
third_code	string	Y	线下申请的第三方标识third_code
seq	string	Y	任务参数, 多值以英文逗号连接, 可选参数: repair, colour, sr, bg, scratch, defogging
type	string	N	图像类型, 默认 people, 可选参数: people, cortoon, landscape, portrait, text
file	file	Y	图像文件, 可传多次
rate	int	N	超分倍数, 默认 0, 可选参数: 2, 4, 8
rgb	string	N	底色值, bg in seq 时必传, 可选参数: -1, 1, 235,51,35(红), 85,142,213(蓝), 255,255,255(白)
dpi	int	N	分辨率, 300DPI则传300
platform	string	Y	平台, 可选参数: pc, h5, mp, ios, baidu, zijie, douyin, alipay
clientip	string	N	客户端IP
mdf	string	N	再次处理, 必传, 可传多次
Curl
curl --location --request POST 'http://sdkphoto.fangtangtv.com/api/third/uploads' --header 'token: xxx' --form 'third_code="test"' --form 'seq="bg"' --form 'file=@"/VSCode/image/3c6b4b786c1159441a94e3508c36508b.png"' --form 'rgb="1"' --form 'platform="pc"'
Response
field	commit
img_url	上传图片的url
mdf	图片的唯一标识
{
    "code": 200,
    "data": {
        "mdf": [
	"40b37f58db153e5149f008421797714e"
	]
	}
}
失败时(errno说明)
errno	commit
9999	请求参数token不合法
9101	剩余下载次数为0
9001	传入参数错误
9005	文件上传类型不支持
9006	上传失败
9009	图片异常,处理失败
{
    "code": 9000,
    "errno": 9005,
    "msg": "文件上传类型不支持"
}
2、图片修复状态查询
URL /api/third/status
Method POST
Header token: 加密生成的token,加密规则见附1
Params
field	type	required	commit
third_code	string	Y	线下申请的第三方标识third_code
mdf	string	Y	文件唯一标识
platform	string	Y	平台, 可选参数: pc, h5, mp, ios, baidu, zijie, douyin, alipay
Curl
curl --location --request POST 'http://sdkphoto.fangtangtv.com/api/third/status' --header 'token: xxx' --form 'third_code="test"' --form 'mdf="9804b4cb5b4740fb26afde5f2831c0f5"' --form 'platform="pc"'
Response(正常时)
{
	"code": 200,
	"data": {
	"msg": "获取任务状态成功",
	"status": 200
	"mdfs": [
	{
		"mdf":"9804b4cb5b4740fb26afde5f2831c0f5",
		"state": "任务处理完成",
		"src_url": "",
		"wmk_url":"",
		"icon_url": "",
		"res_size": "1080x1366px 146KB"
	}
	]
}
	}
Response(失败时)errno说明
errno	commit
9002	图片不存在
500	其他错误
{
    "code": 9000,
    "errno": 9002,
    "msg": "图片不存在,请确认图片是否上传成功"
}
3、图片下载
URL /api/third/download
Method POST
Header token: 加密生成的token,加密规则见附1
Params
field	type	required	commit
third_code	string	Y	线下申请的第三方标识third_code
mdf	string	Y	文件唯一标识
Curl
curl --location --request POST 'http://sdkphoto.fangtangtv.com/api/third/download' --header 'token: xxx' --form 'third_code="test"' --form 'mdf="9804b4cb5b4740fb26afde5f2831c0f5"'
Response(正常时)
field	commit
url	图片下载地址
{
	"code": 200,
	"data": {
	"url": "https://sdkphoto.fangtangtv.com/api/third/download/40b37f58db153e5149f008421797714e01100.jpg"
	}
}
Response(失败时)errno说明
errno	commit
9002	图片不存在
500	其他错误
{
    "code": 9000,
    "errno": 9002,
    "msg": "数据已失效,请重新上传"
}
4、剩余上传次数查询
URL /api/third/company/nums
Method POST
Header token: 加密生成的token,加密规则见附1
Params
field	type	required	commit
third_code	string	Y	线下申请的第三方标识third_code
Curl
curl --location --request POST 'XXXXX/api/third/company/nums' \
--header 'token: XXXXX' \
--form 'third_code="XXXXX"'
Response(正常时)
field	commit
code	第三方标识third_code
nums	剩余上传次数
{
    "code": 200,
    "data": {
        "code": "hiliad",
        "nums": 98
    }
}
Response(失败时)errno说明
errno	commit
9002	数据未找到
500	其他错误
{
    "code": 9000,
    "errno": 9002,
    "msg": "数据未找到"
}
附1、token生成规则
1、拿到服务方提供的secret_key,再生成一个当前时间戳time
    secret_key = 'hiliad'
    time = '1629962357'
2、secret_key + time,两字符串拼接,再md5,得到参数mds
    mds = hashlib.md5((secret_key + time).encode("utf8")).hexdigest()
    mds = '5484490c8e797dabe52af90ab8bd1e50'
3、最终的token等于 mds + ',' + time
    token = '5484490c8e797dabe52af90ab8bd1e50,1629962357'

注:生成的时间戳会在2分钟后失效,请每次请求接口都重新生成时间戳
Scan the QR code on WeChat to download HD images without watermarkPackage purchase