Coder Social home page Coder Social logo

douyin's Introduction

抖音无水印视频下载

环境

* PYTHON
* selenium库
* multiprocessing库
* time库
* jsonpath库
* re库
* os库
* Chrome浏览器(版本 78.0.3904.108)

实现方法

  • 复制分享链接到浏览器,XHR分析一波,很明显这个就是我们要的。

  • 看一下链接和请求参数,分析后发现sec_uid、max_cursor、_signature、dytk是我们要找的。简单的那些就不多说了,我们发现 _signature是算法生成的,那就去找吧。

  • 2.png

  • 3.png

  • 先来全局搜索,找一下_signature在哪里。

  • 4.png

  • 哦豁,九曲十八弯呀!那就继续找喽

  • 5.png

  • 6.png

  • 找到这里我们发现,它是require返回的,那继续看看这是个什么东西喽

  • 7.png

  • 看到这里,大概心里已经有谱了。我这里没有仿照它加密过程写,我是直接将它的算法弄过来,写到html文件调用的。(断点调试比我上面这样找更快哦,我这样之是为了让你们理解得更清楚点而已。)

函数说明

  • get_data() 获取uid、dytk、tac、signature等参数
  • get_videourl() 获取视频下载链接
  • down() 视频下载 (这里将下载的代码给清空了,想下载请求头模拟成手机自己写哈)

文件结构

  • video存放下载的无水印视频
  • douyin.py是主程序
  • page.html和get_s.html分别是_signature的算法页面和拼接了tac的算法页面

闲聊

  • 有空用类重写一遍,现在就当做是学习啦。
  • 运行程序报错的话估计是你的chrome浏览器和我的不一样哦,因为我selenium的chrome驱动用的是(适合chrome版本 78.0.3904.108)的。

douyin's People

Contributors

kokozh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.