Today, I would like to share with you a video on how to download Douyin without watermarks using Python. You might ask, well, what’s the use of this? Of course it works. So what’s the use? The following small make up to tell you in detail.

As we all know, due to the popularity of short videos now, a batch of we-media creators have mushrowed out, and some of them want to steal others’ successful works opportunely. This behavior is often dubbed white piao, ha ha ha, no more nonsense, roll up your sleeves is to look at.

A, preparation,

Sublime Text 3, 360 browser, Python 3.6 runtime

Second, demand analysis

First of all, we need to figure out how and when the watermark of Douyin video is generated, so that we can easily find the address of the original video, and then we can download it directly.

Three, operation practice

We open a douyin video on our mobile phone, click the copy link, copy the link and open it in the computer browser, such as the Douyin video about Li Yuanba:

How many heroes were black, just to apotheosize yuan bully a dementia patients https://v.douyin.com/wCgKrh/ to copy the link, open the trill short video 】 【, watch the video directly!Copy the code

Copy the link to open the browser, you can see this picture, as shown below:

Then we will find the video with the watermark of Douyin, obviously this is not convenient for us to whine other people’s excellent works, open the review elements to check, as shown below:

For the sake of program aesthetics, we can write a GUI interface:

class page: def __init__(self): Self.root = tk.tk () # Initialize the window self.root. Title (' Tk. unwatered-video download V1.0 ') # select self.root. Geometry ("700x700") # select self.root. Self.root. resizable(width=True,height=True) # Create tag, text, background color, font (color, size), Self. label1 =tk.Label(self.root,text=' t ') self.label1 =tk.Label(self.root,text=' t ') ',font=('宋体',10),width=12,height=2) Self. e1 =tk. Entry(self.root,width=30,show=None, font=('Arial', 12)) self.label2 =tk.Label(self.root,text=' filename: ',font=('宋体',10),width=12,height=2) Self. e2 = tk.Entry(self.root,width=30,show=None, font=('Arial', Self. b1 = tk.Button(self.root, text=' download without watermark ', Column =1, height=1,command=self. Button(self.root, text=' empty ', width=8,height=1,command=self.close) self.photo=tk.PhotoImage(file = '111.gif') self.im=tk.Label(self.root, image = self.photo) self.photo1=tk.PhotoImage(file = '222.gif') self.im1=tk.Label(self.root, Image = self.photo1) self.dashang=tk.Label(self.root,bg='gray',fg='blue',font=('宋体',12),text=' Self.label1. place(x=140,y=30,anchor='nw') self.e1.place(x=210,y=32,anchor=' NW ') self.b2.place(x=500,y=40,anchor='nw') self.label2.place(x=144,y=60,anchor='nw') self.e2.place(x=210,y=62,anchor='nw') self.b1.place(x=230,y=110,anchor='nw') self.dashang.place(x=60,y=160) self.im.place(x=10,y=200,width=202,height=313,anchor='nw') self.im1.place(x=300,y=200,width=202,height=313,anchor='nw') Self. B3 =tk.Button(self.root,text=' weblog ', ',command=self.refer) self.b3.place(x=200,y=530,width=140,height=40,anchor='nw') self.root.mainloop()Copy the code

The effect is not bad, you can see:

Next we will write the download implementation code snippet, as follows:

def download(self): url='http://www.zimo.wiki:8080/douyin-video-crawler/api/analysis?url='+self.e1.get() try: rep=requests.get(url,timeout=5) result=rep.text res=eval(result) if res.get('msg')=='analysis success': down_url=res.get('url') data=requests.get(down_url,stream=True,timeout=4) with open('{}.mp4'.format(self.e2.get()),'wb')  as f: f.write(data.content) else: msg.showwarning('notice','URL Format Error!!! ') except: returnCopy the code

Here we use a Douyin parsing interface:

http://www.zimo.wiki:8080/douyin-video-crawler/api/analysis?url=
Copy the code

As long as you add the URL of douyin video after it, you can resolve the video without watermark, isn’t it very powerful?

We filled in the address and found it was like this, as shown in the figure:

Let’s copy the address indicated by the red line to the address bar to access the video without watermark!

Get the real address and download it.

To make it more complete, we add close and jump operations, as shown in the picture:

Self.e1.delete (0,'end') def refer(self): self.e1.delete(0,'end') def refer(self): # jump wb. Open (' https://url.ms/lypks')Copy the code

The last step, of course, is to start the program.

page()
Copy the code

Get the following screen:

As you can see, there is no watermark at all.

Four,

The techniques described in this article are not high end or cutting edge, but they are useful. Thank you for your attention and support, I will post more practical code skills.