求抖音短链接批量转长链接的方法? 比如:https://v.douyin.com/U6j7mwy/ 转:“https://www.douyin.com/video/7234406482719149351 链接, 批量
[Python] 纯文本查看 复制代码import requests shorturl = 'https://v.douyin.com/U6j7mwy/' headers = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42', 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6', } response = requests.head(shorturl, headers=headers) url = 'https://www.douyin.com/video/' + response.headers['Location'].split('/')[-2] print(url)
T4DNA 发表于 2023-5-18 16:38 [mw_shl_code=python,true]import requests shorturl = 'https://v.douyin.com/U6j7mwy/' 铁子 问题是我不会用py,有没有小白可以用的?