Code Monkey home page Code Monkey logo

douyin_uplod's Introduction

douyin_uplod

  • 从0自动生成发布视频,解决你不知道发什么视频的烦恼。
  • demo的实例是每天5点20分,单号生成并发送舔狗日记,双号生成并发送心灵鸡汤。你们可以根据自己的需求修改下。
  • 示例抖音号

原理

  1. 使用apscheduler开启计划任务,每天x点x分运行
  2. 通过自定义的文字以及背景音乐合成音频【使用了微软语音合成】
  3. 通过音频和临时视频片段合成视频【使用了ffmpeg】
  4. 通过playwright发布合成的视频

技术栈

  • python
  • playwright
  • ffmpeg
  • apscheduler

前期准备

  • 微软azure注册
  • 没有海外卡的同学,淘宝搜索微软azure注册
  • 准备至少2个临时视频片段,最好可以循环重复的静音视频
  • 安装python
  • 安装playwright、ffmpeg、apscheduler,执行以下命令
  • 下载ffmpeg
pip install apscheduler
pip install ffmpy
pip install playwright
python -m playwright install
  • 然后通过playwright把cookie文件保存下来,执行以下命令,扫码登录完成后即可
playwright codegen www.douyin.com --save-storage=cookie.json
  • ffmpeg需要添加到环境变量,如不添加需要修改ffmpeg.exe目录ctrl+左键点击ffmpeg进入,把executable='ffmpeg.exe'修改成你下载ffmpeg的目录
def __init__(
        self, executable=r'E:\ffmpeg\ffmpeg-5.0.1-essentials_build\bin\ffmpeg.exe', global_options=None, inputs=None, outputs=None
    )

结尾

  • qq交流群:916790180
  • 本源码只是出于学习交流的目的,非法使用发送不良视频等与作者无关

douyin_uplod's People

Contributors

superheroff 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.