一个朋友的请求需要大量下载无水印的痘印视频做转载。整个编程的思路就是通过地址的拼接最终拼接出无水印的地址。没什么难度。

import requests
import re
import urllib.request
print('抖音无水印下载工具 V1.0')
data_list = input('请输入下载视频列表地址:')
data_update=input('请输入储存地址:')
headers = {
	'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6'
}
a=1
for i in open(data_list):
	i.strip()
	res = requests.get(headers=headers,url=i,timeout=3)
	re_res = re.search(r'video_id=(.*)&line',str(res.text)).group(1)
	new_url = 'https://aweme.snssdk.com/aweme/v1/play/?video_id='+re_res+'&line=0'
	new_res=requests.get(headers=headers,url=new_url,timeout=3)
	f=urllib.request.urlopen(str(new_res.url))
	print('正在下载第'+str(a)+'视频')
	data=f.read()
	with open(data_update+'/'+str(a)+'.mp4','wb') as code:
		code.write(data)
	a+=1
print('下载完成')

“竹杖芒鞋轻胜马,谁怕,一蓑烟雨任平生。”