唉,算了,反正我好了。帮助后来人。
腾讯云 cdn 鉴权 Type A 示例 Python
cdn = 'your-cdn-address.file.myqcloud.com'
key = 'your_key'
sign = 'sign'
rand = random.randint(1500000000, 1600000000) # 随意 字母也可以 长度上限100
uid = random.randint(10000, 100000) # 随意
file = '/sample.png' # 文件路径
ts = int(time.time())
print(f'timestamp: {ts}')
s = f'{file}-{ts}-{rand}-{uid}-{key}'
print(f's: {s}')
token = hashlib.new("md5", s.encode()).hexdigest()
print(f'md5: {token}')
url = f'https://{cdn}/{file.strip("/")}?{sign}={ts}-{rand}-{uid}-{token}'
keywords: 腾讯云 cdn 鉴权 Type A (Type B / Type C / Type D)
PS: 目前 Type B 即使鉴权通过也会 找不到文件。C和D未测试。