In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
What this article shares with you is about Python how to climb Douyin video without watermark. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article. Without saying much, let's take a look at it with the editor.
Use a simpler method
Casually open a Douyin personal home page, I chose iqiyi Sports, then right-check the elements of the page, click the xhr option under the network tab, and analyze the captured package
Click on the preview tab and click video- > download_addr- > url_list
When I got to this site, I thought it was over, but a boss @ Jinshingli sent me an article reminding me of something I didn't expect. Thank you here!
Let's move on, there is also a link under the play_addr below, and the video below is the unwatermarked version.
Code
Import requestsimport jsonimport jsonpathclass Douyin: def page_num (self Max_cursor): # Random code random_field = '00nvcRAUjgJQBMjqpgesfdNJ72Secretdytkus4a01c95562f1f10264fb14086512f919' # body url =' https://www.iesdouyin.com/web/api/v2/aweme/post/?sec_uid=MS4wLjABAAAAU7Bwg8WznVaafqWLyLUwcVUf9LgrKGYmctJ3n5SwlOA&count=21&max_cursor=' + str (max_cursor) +'& aid=1128&_signature=' + random_field # request header headers = {'user-agent':'Mozilla/5.0 (X11) Linux x86 / 64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36',} response = requests.get (url) Headers=headers) .text # convert to json data resp = json.loads (response) # extract to max_cursor max_cursor = resp ['max_cursor'] # traversal for data in resp [' aweme_list']: # Video introduction video_title = data ['desc'] # extract paly_ using jsonpath syntax Addr video_url = jsonpath.jsonpath (data '$.. paly_addr') for an in video_url: # extract the first link address video_realurl = a [' url_list'] [1] # request video video = requests.get (video_realurl, headers=headers) .content with open ('tbank' + video_title 'wb') as f: print (' downloading:', video_title) f.write (video) # determine the condition for stopping the construction of the URL if max_cursor==0: return 1 else: douyin.page_num (max_cursor) if _ _ name__ ='_ main__': douyin = Douyin () douyin.page_num (max_cursor=0)
Advantages
The advantage of this method is that it can save a large part of the steps of analyzing the URL, and there is no call to webdriver (the browser can not be limited), the speed will be significantly improved, and the resulting video is also unwatermarked.
Deficiency
It still doesn't solve the problem of randomly generating strings, and the operation is troublesome.
This is how Python crawls Douyin videos without watermarks. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.