2022年-抖音最新去水印解析脚本,python

Published on

dy (1).png

朋友想要弄个接口,无聊抓包也下。只需要请求一个接口就好了

希望转载注明一下来源,就不弄回复可见了。

#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
@author: chuxia
@contact: 676463@qq.com
@blog: https://qq.cool
@file: dy.py
@time: 2022/4/16 9:50 上午
'''
import requests


class Douyin:
    s = requests.Session()
    s.headers.update({
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36"
    })

    def __init__(self, url: str):
        self.url = url

    def run(self):
        res = self.s.get(self.url).url
        ids = res.split('video/')[1].split('?')[0]
        self.ids = ids
        self.getVideoInfo()

    def getVideoInfo(self):
        res = self.s.get('https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?item_ids=' + self.ids).json()
        print(
            res['item_list'][0]['video']['play_addr']['url_list'][0].replace('playwm', 'play').replace('720p', '9999'))


url = 'https://v.douyin.com/NT4n1H8/ '
dy = Douyin(url)
dy.run()
User Avatar
···
2022-10-29
good,研究一下
User Avatar
哎合
2022-10-25
yes
User Avatar
戒心
2022-10-22
不错 来一个吧
User Avatar
野狼
2022-09-02
dfsafsf
User Avatar
慎独
2022-08-31
test