2019最新去抖音水印python源码

   import hashlibimport base64import timeimport requestsimport jsonimport lxml.htmldef base64encode(text: str, reverse_map: bool = False) -> str:if reverse_map is False:return base64.b64encode(text.encode()).decode()c--------------------- 
作者:程序员小狐狸 
来源:CSDN 
原文:https://blog.csdn.net/weixin_45342712/article/details/96130223 
版权声明:本文为博主原创文章,转载请附上博文链接!base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="[::-1]r = ""  # the resultc = 3 - len(text) % 3  # the length of paddingp = base64chars[-1] * c  # the paddings = text + "\0" * c  # the text to encodei = 0while i < len(s):if i > 0 and ((i / 3 * 4) % 76) == 0:r = r + "\r\n"n = (ord(s[i]) << 16) + (ord(s[i + 1]) << 8) + ord(s[i + 2])n1 = (n >> 18) & 63n2 = (n >> 12) & 63n3 = (n >> 6) & 63n4 = n & 63r += base64chars[n1] + base64chars[n2] + base64chars[n3] + base64chars[n4]i += 3return (r[0: len(r) - len(p)] + p).lower()# link = input('请粘贴抖音的链接:')link = 'http://v.douyin.com/rgGpHL/'# t = '1560489959057't = time.time()res = link.strip() + str(int(t))QQ 688244617免费自取更多Python学习资料r = base64encode(hashlib.md5(res.encode()).hexdigest(), True)print(r)answer = 'ztgon6ohn64k09=mntkpongmz60l060qz6nb0t/dn9ka'data = {'pageUrl': link,'t': t,'s': r,}response = requests.post('http://www.kaolajiexi.com/ajax/parse.php', data=data)print(response.text)u = json.loads(response.text)['data']['data']['sourceUrl']print(u)headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36'}text = requests.get(link, allow_redirects=True, headers=headers).textdom = lxml.html.etree.HTML(text)title = dom.xpath('//p[@class="desc"]/text()')[0]name = dom.xpath('//p[@class="name nowrap"]/text()')[0][1:]QQ 688244617免费自取with open(f'{name} - {title}.mp4', 'wb') as f:f.write(requests.get(u).content)

在这里插入图片描述


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部