GithubHelp home page GithubHelp logo

east196 / sorrypy Goto Github PK

View Code? Open in Web Editor NEW
352.0 13.0 112.0 27.73 MB

GIF神器sorry的python重制版

Home Page: https://east196.github.io/sorrypy/

License: Apache License 2.0

Python 45.47% JavaScript 8.18% Smarty 12.23% CSS 33.74% Dockerfile 0.39%
sorry python jinja2 ffmpeg

sorrypy's Introduction

sorrypy

sorry有钱真的可以为所欲为

说明

sorry是一款很有意思的应用,源自于sorry有钱真的可以为所欲为这个梗。 亮点是可以换自己的梗生成gif。

可惜部署环境是ubuntu+ruby,我就重制了个全平台的python重置版博大家一笑。

荣誉首先属于xtyxtyx

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

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

Docker部署

一行搞定

docker-compose up -d

如果难以直视950.18 MB的 Docker 镜像,请移步普通安装部署

普通安装部署

  1. 下载安装python3

  2. cmd命令行安装必须包 pip install flask pillow imageio ffmpeg-python moviepy 当然也可以 pip install -r requirements.txt

  3. 安装ffmpeg ffmepg官网下载安装ffmepg并加入path。

检验ffmpeg安装

ffmpeg -version

尽量使用3.4以上版本,低版本可能会无法生成或者生成无字幕gif

  1. 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 & Gitee

💹 关注统计

Github

Github

sorrypy's People

Contributors

dependabot[bot] avatar east196 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sorrypy's Issues

请问如何运行使得能外网访问

先感谢dalao的重置,下载运行发现默认在127.0.0.1运行,我是在服务器上架的,想知道如何修改,要是能修改端口就更好了_(:з」∠)_(

目录对不上啊

怎么都是/什么什么的
还有找不到The requested URL /tpl/wangjingze/ was not found on this server.
主目录应该在哪?有点笨我,不会部署
能教教不

这个什么情况

builtins.FileNotFoundError
FileNotFoundError: [Errno 2] No such file or directory: 'static/sorry/template.tpl'

求教报错EnvironmentError: HTTPSConnectionPool

下载中间出了问题,不清楚为什么,是我个人的网络代理问题吗?
ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/2c/af/f04cd614c5125a1b2d47324ec0f16fdae3abe1df5bacc4f4d80db7b679c1/imageio_ffmpeg-0.3.0-py3-none-win_amd64.whl (Caused by ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000025EAD36D100>, 'Connection to files.pythonhosted.org timed out. (connect timeout=15)'))

提交后按钮一直停在"请稍后"

打出的日志停留在下面的一句话
ffmpeg -i static/sorry/template.mp4 -r 8 -vf ass=static/cache/sorry-d1911fe36d7b58c9f7b3950bb62bd2fb.gif.ass,scale=300:-1 -y static/cache/sorry-d1911fe36d7b58c9f7b3950bb62bd2fb.gif

cpu和内存占用都很正常,不像是服务器卡住的问题啊?

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.