Giter Club home page Giter Club logo

20201225-201552-914's Introduction

抖音爬虫获取抖音cookies(CK)

分析

  1. Cookie中文名称为小型文本文件,指某些网站为了辨别用户身份而储存在用户本地终端(Client Side)上的数据(通常经过加密)。
  2. 有时也用其复数形式Cookies,指某些网站为了辨别用户身份、进行session跟踪而储存在用户本地终端上的数据(通常经过加密)。
  3. 抖音核心的cookies是sessionID值, 可嵌套到接口的headers里的Cookie里进行请求。
  4. 目前有研究出有三种获取ck的方法:
    (1). 通过web端的扫码获取到cookies
    (2). 通过app端抖音的账号和密码进行获取到cookies
    (3). 通过app端的验证码进行获取cookies

一、web扫码获取

通过抖音企业管理平台: https://e.douyin.com/site/

抓包分析

image.png
红色标记为 base64 图片, 进行本地保存并打开, 即是登录的二维码
image.png
然后在去实时的请求二维码状态, 数据包的data.status

字段 状态
new 未扫码
scanned 已扫码待确认登录
confirmed 已确认登录

部分代码截图

image.png

二、账号密码登录获取Cookie(为保护隐私,打码请理解)

抓包分析

image.png

请求为POST, 在请求体中mobile和password进行加密, 破解了mobile和password就可以请求登录后cookies里的session值了

直接上代码

image.png
返回的cookies可直接嵌套到请求其他接口的headers头里面, 即可进行进行点赞和关注等操作接口了

三、发送验证码登录获取Cookie

抓包分析

image.png
红色标识的是将YZ发送到10690032183903进行验证
image.png
点击登录后, 发送验证接口, 确认发送成功进行登录, 红色标记为登录时的verify_ticket值, 进行验证
验证码状态

字段 状态
auth_failed 未发送验证码

直接上代码

image.png
将session_key嵌套到headers里的Cookie里即可

——————————————————————————————————————————

TiToData:专业的短视频、直播数据接口服务平台。

更多信息请联系: TiToData

覆盖主流平台:抖音,快手,小红书,TikTok,YouTube

20201225-201552-914's People

Contributors

0xxfu 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.