抖音爱心代码python
时间: 2023-11-15 22:00:42 浏览: 211
这段Python代码可以用于批量取消抖音作品的喜欢。首先,需要设置抖音App的cookie,然后设置抖音作品的aweme_id。接着,使用for循环遍历所有的aweme_id,构建取消喜欢的接口url,最后发送post请求。具体代码如下:
import requests
# 设置抖音 App 的 cookie
cookies = {'cookie': 'your_cookie'}
# 设置抖音作品的 aweme_id
aweme_ids = ['xxxx', 'xxxx', 'xxxx']
for aweme_id in aweme_ids:
# 构建取消喜欢的接口
url = f'https://aweme.snssdk.com/aweme/v1/commit/item/digg/?aweme_id={aweme_id}'
# 发送 post 请求
response = requests.post(url, cookies=cookies)
# 输出取消喜欢结果
print(response.json())
阅读全文
相关推荐














