# -*- coding: utf-8 -*-
# @Author: wangkun
# @Time: 2023/6/19
import json
import requests
v_id = 53456805
p_mid = 13988857
album_id = 5077977542
url = "https://kapi-xng-app.xiaoniangao.cn/v3/album/detail"
serial_id = 'sQ0Gh01aa3sw0002'
tpl_id = 100022

payload = "{\"log_ext\":{\"from_page\":\"\"},\"detail\":{\"tpl_id\":0,\"id\":53509608,\"share_width\":300,\"ab\":null,\"album_id\":5082121772,\"serial_id\":\"sQ0Gh01aa2Gy000H\",\"profile_mid\":1160417275,\"ref\":\"\",\"stpl_id\":null,\"share_height\":240,\"rec_sign\":\"app_dft_v1\"},\"refresh\":false,\"log\":{\"net\":\"wifi\",\"product\":\"xng\",\"page\":\"\",\"idfa\":\"\",\"brand\":\"iPad\",\"pf\":\"4\",\"os_version\":\"15.7\",\"uid\":\"2F310D09-5E32-5985-8644-3BCB6920E76F\",\"channel\":\"ios_app_store\",\"device\":\"iPad Pro (12.9-inch) (3rd generation)\",\"resolution\":\"750*1334\",\"session_id\":\"F4249B34-B3C6-4AEE-824E-B95BFE3AC8AE\",\"app_version\":\"1.22.5\"},\"rec\":{\"ext\":{\"current_item\":53509608,\"items\":[{\"play_du\":2,\"id\":53446151}]}},\"staggered_style\":0,\"token\":\"\"}"
payload_dic = json.loads(payload)
# payload_dic['detail']['id'] = v_id
# payload_dic['detail']['profile_mid'] = p_mid
# payload_dic['detail']['album_id'] = album_id
# payload_dic['detail']['serial_id'] = serial_id
# payload_dic['detail']['tpl_id'] = tpl_id
payload_new = json.dumps(payload_dic)
headers = {
  'Host': 'kapi-xng-app.xiaoniangao.cn',
  'content-type': 'application/json; charset=utf-8',
  'accept': 'application/json',
  'authorization': 'f1uxuL49wq2h3T+rYLA4ZeiIemQ=',
  'verb': 'POST',
  'content-md5': '5ab99134ed723cd49c0b30b0da24fd10',
  'x-b3-traceid': '5449e3265c96701b',
  'accept-language': 'zh-Hans-CN;q=1.0',
  'date': 'Mon, 19 Jun 2023 11:20:37 GMT',
  'x-token-id': '',
  'x-signaturemethod': 'hmac-sha1',
  'user-agent': 'xngapp/1.22.5 (cn.xiaoniangao.xngapp; build:157; iOS 15.7.0) Alamofire/5.2.2'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
