抖音无水印下载
用到selenium+requests+bs4+tkinter
对于设置禁止下载的视频也适用
1.提取链接
2.google浏览器打开——selenium
3.找到有水印的视频网址,去除水印——bs4
4.伪装成手机浏览器下载视频——requests
import tkinter as tk
import tkinter.messagebox
from tkinter.filedialog import askdirectory
from tkinter import *
from selenium import webdriver
from time import sleep
from bs4 import BeautifulSoup
import random
import requests
headers = {
'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/84.0.4147.105'}
def get_http():
info = t1.get(1.0, 'end')
if ' 复制' in info:
url1 = info.split('ht')[1].split(' 复制')[0]
url = 'ht' + url1
else:
url = info
print('网址提取成功')
t2.insert(END