Code Monkey home page Code Monkey logo

sorrypy's Introduction

sorrypy

sorry有钱真的可以为所欲为

说明

sorry是一款很有意思的应用,源自于sorry有钱真的可以为所欲为这个梗。 亮点是可以换自己的梗生成gif。 可惜部署环境是ubuntu+ruby,我就重制了个全平台的python重置版博大家一笑。 荣誉首先属于xtyxtyx

Hardy兄弟NodeJs版:node-sorry也非常好用,有DEMO为证,嘎嘎。

sorry客户真的可以为所欲为样例:

部署

  1. 下载安装python3
  2. cmd命令行安装必须包 pip install flask pillow imageio ffmpeg-python moviepy 当然也可以 pip install -r req.txt
  3. 安装ffmpeg ffmepg官网下载安装ffmepg并加入path。 检验ffmpeg安装
ffmpeg -version

尽量使用3.4以上版本,低版本可能会无法生成或者生成无字幕gif。 4. cmd中运行

python app.py
  1. 浏览器打开 http://127.0.0.1:8000/ 然后你就可以为所欲为了~~~

CentOS7下ffmpeg安装

wget https://ffmpeg.org/releases/ffmpeg-3.4.2.tar.bz2
yum -y install bzip2
yum -y install yasm
yum -y install libass libass-devel
tar -xf ffmpeg-3.4.2.tar.bz2
cd ffmpeg-3.4.2
./configure --enable-libass
make
make install

Windows下ffmpeg安装

方便起见,已直接将最新版ffmpeg.exe放入项目根目录,所以无需下载。 如果需要全局使用ffmpeg,可参考这篇文章

适配新Gif

目前,想要适配新的gif,需要改动3个文件(修改前建议备份)

templates/sorry/index.html
static/sorry/template.mp4
static/sorry/template.tpl

其中

index.html  按照句子的多少删掉或者增加<input>即可
template.mp4   替换成新视频
template.tpl   替换成新的字幕模板

字幕模板template.tpl

首先使用aegisub为模板视频创建字幕,保存为sorry.template.ass

aegisub教程

图片

然后把文本替换成模板字符串 {{ sentences[n] }} 懒得换图了哈,以这个字符串为准

图片

最后保存为template.tpl

现在这个网站就可以制作新的gif了

Note

欢迎 star ~ fork ~~

Github & 码云

TODO

  • 加入锁机制限制并发
  • 自动生成页面

sorrypy's People

Contributors

east196 avatar

Stargazers

Roman avatar

Watchers

 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.