批量下载抖音单用户视频(增强版):
import requests
import json
import os
import time
import re
import sys
import winsound
"""
1.根据用户页面分享的字符串提取短url
2.根据短url加上302获取location,提取sec_id
3.拼接视频列表请求url
params = {
'sec_uid' : 'MS4wLjABAAAAbtSlJK_BfUcuqyy8ypNouqEH7outUXePTYEcAIpY9rk',
'count' : '200',
'min_cursor' : '1612108800000',
'max_cursor' : '1619251716404',
'aid' : '1128',
'_signature' : 'PtCNCgAAXljWCq93QOKsFT7QjR'
}
"""
headers = {
"user-agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Mobile Safari/537.36"
}
##############################################
# 可以选择:
# 1文件内编辑好
# 2交互窗口输入
# 3命令行传参
# string = 'https://v.douyin.com/ePPVX3Q/'
# string = input('INPUT URL (like:【在抖音&
|