python抖音取消
时间: 2023-07-29 20:13:08 浏览: 212
python无水印下载抖音短视频
抖音取消喜欢的操作可以通过发送POST请求到抖音的接口来实现。你可以使用以下Python代码来批量取消抖音喜欢:
```python
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)
# 检查请求是否成功
if response.status_code == 200:
print(f'取消喜欢成功,作品ID:{aweme_id}')
else:
print(f'取消喜欢失败,作品ID:{aweme_id}')
```
请注意,你需要将`your_cookie`替换为你自己的抖音cookie,以及将`aweme_ids`替换为你要取消喜欢的作品的ID列表。这段代码会依次取消每个作品的喜欢。如果请求成功,将会打印出取消喜欢成功的消息,否则将会打印出取消喜欢失败的消息。\[1\]
#### 引用[.reference_title]
- *1* [帮我写一个批量取消抖音喜欢的Python代码](https://blog.csdn.net/weixin_35749796/article/details/129600685)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [python-抖音](https://blog.csdn.net/benben0729/article/details/80244436)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [Python自动化抖音自动刷视频](https://blog.csdn.net/weixin_45248492/article/details/129584410)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文