All Projects → LindseyB → Starwars Dot Gif

LindseyB / Starwars Dot Gif

Licence: wtfpl
Python script to generate gifs from star wars

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Starwars Dot Gif

Whatsapp Web Bot
Whatsapp Web Bot - Example of Bot for use on Whatsapp Web (on Chrome)
Stars: ✭ 450 (-7.22%)
Mutual labels:  bot
Onebot
OneBot 标准:一个聊天机器人应用接口标准
Stars: ✭ 455 (-6.19%)
Mutual labels:  bot
Alertmanager Bot
Bot for Prometheus' Alertmanager
Stars: ✭ 473 (-2.47%)
Mutual labels:  bot
Yagpdb
Yet another general purpose discord bot
Stars: ✭ 452 (-6.8%)
Mutual labels:  bot
Werewolf
Werewolf for Telegram
Stars: ✭ 458 (-5.57%)
Mutual labels:  bot
Bot
The community bot for the Python Discord community
Stars: ✭ 460 (-5.15%)
Mutual labels:  bot
Tgbot Cpp
C++ library for Telegram bot API
Stars: ✭ 439 (-9.48%)
Mutual labels:  bot
Stealth
An open source Ruby framework for text and voice chatbots. 🤖
Stars: ✭ 481 (-0.82%)
Mutual labels:  bot
Robodanny
A discord bot for servers that I like.
Stars: ✭ 459 (-5.36%)
Mutual labels:  bot
Fredboat
A Discord music bot sharing 1 million servers with 20 million users
Stars: ✭ 471 (-2.89%)
Mutual labels:  bot
Botbuilder Python
The Microsoft Bot Framework provides what you need to build and connect intelligent bots that interact naturally wherever your users are talking, from text/sms to Skype, Slack, Office 365 mail and other popular services.
Stars: ✭ 457 (-5.77%)
Mutual labels:  bot
Nlp.js
An NLP library for building bots, with entity extraction, sentiment analysis, automatic language identify, and so more
Stars: ✭ 4,670 (+862.89%)
Mutual labels:  bot
D Zone
An ambient life simulation driven by user activity within a Discord server
Stars: ✭ 466 (-3.92%)
Mutual labels:  bot
Insta Mass Account Creator
Instagram Auto Account Creation Bot
Stars: ✭ 452 (-6.8%)
Mutual labels:  bot
Telegraf
Modern Telegram Bot Framework for Node.js
Stars: ✭ 5,178 (+967.63%)
Mutual labels:  bot
Discord Bot Client
A patched version of discord, with bot login support
Stars: ✭ 441 (-9.07%)
Mutual labels:  bot
Wechat Bot
带二次开发接口的PC微信聊天机器人
Stars: ✭ 458 (-5.57%)
Mutual labels:  bot
Line Bot Sdk Java
LINE Messaging API SDK for Java
Stars: ✭ 484 (-0.21%)
Mutual labels:  bot
Vim Chat
💜 Chatting plugin for neovim and vim8
Stars: ✭ 475 (-2.06%)
Mutual labels:  bot
Botbuilder Js
Welcome to the Bot Framework SDK for JavaScript repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using JavaScript.
Stars: ✭ 469 (-3.3%)
Mutual labels:  bot

Star Wars DOT Gif

Quickstart

Setup

Copy the contents of config.cfg.example into config.cfg and make sure to change the relevant paths for VLC or ffmpeg and the Star Wars episodes. Any format that can be read by VLC or ffmpeg should be acceptable for the movies. Note, if you don't plan on running the twitter bot you only need to fill out the general section of the cfg file.

Install python requirements:

pip install -r requirements.txt

Verify you have either vlc or ffmpeg installed (we just need one of both):

$ whereis vlc
vlc: /usr/bin/vlc /usr/lib64/vlc /usr/share/vlc /usr/share/man/man1/vlc.1.gz
$ whereis ffmpeg
ffmpeg: /usr/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz

Usage

To Run with search UI (sample run)

By default the gif is created as star_wars.gif

python star_wars_gif.py

To get a random gif

python make_gifs.py

Embedding in another python-script

If you want to use make_gifs elsewhere use:

from make_gifs import make_gif
# source should be a slug from config.cfg
# index is the index of the quote in the SRT
# for more options see make_gifs.py
make_gif(source, index)

Running the twitter bot

  • make sure you create API accounts for both twitter and imgur
  • update config.cfg to have the keys for both
  • run python twitter_bot.py

The bot will tweet once every hour.

Notes

In detail

It is assumed you have virtualenv installed. If not, it is not very difficult to install or use and will keep your system-python free of fancy packages we are using here.

Requirements

  • python (tested with 2.7 and 3.6)
  • ffmpeg or vlc
  • video-files for movies/videos you want to extract from

Setup Procedure

Create a virtalenv and install python requirements:

cd starwars-dot-gif
virtualenv .env
source .env/bin/activate
(.env)$ pip install -r requirements.txt

Now copy the example config provided and edit with your favourite editor:

cp config.cfg.example config.cfg
vim config.cfg

You must set a path for vlc or ffmpeg, if both are set, ffmpeg will be preferred over vlc. Setting 'vlc' or 'ffmpeg' instead of a path is acceptable if those are executable as-is on your system.

The repository currently includes subtitles for Star Wars episode IV to VIII, you are free to add more video-files with corresponding subtitles (see config.cfg.example). It is recommended that you remove any entires which you do not want to use from the videos-list in the config.

To test the configuration you may run the script with the --help-option, which will give you an extensive explanation of options.

(.env)$ python make_gifs.py --help
usage: make_gifs.py [-h] [--movie [MOVIE [MOVIE ...]]] [--index [INDEX]]
...

Detailed Usage

You may use the script with your config.cfg either with an interactive commandline-tool or directly pass options on the commandline.

Commandline-tool

The commandline-tool has a GUI of sorts and allows you to search in the subtitles. This allows you to look for specific words or quotes you are looking for.

(.env)$ python star_wars_gif.py

This script will ignore any arguments passed to it.

Direct

The direct method can be called from the commandline or from another python script. These options are nearly equally powerful. Using the commandline you may pass any number of options (call with --help to see all of them).

The following command will create a gif with the quote "Aren't you a little short for a stormtrooper?".

(.env)$ python make_gifs.py --movie hope --index 848

Now adding some options:

(.env)$ python make_gifs.py --movie hope --index 848 --padding 0 0.6 --subtitle "I have been expecting you"

This added 0.6 seconds (and a confused Luke) to the end of the gif and changed the rendered subtitle to "I have been expecting you". As previously mentioned there are many more options available.

When called from python usage follows a general pattern:

from make_gifs import make_gif
# source should be a slug from config.cfg
# index is the index of the SRT
# for more options see make_gifs.py
make_gif('hope', 848, padding=[0, 0.6], custom_subtitle="I have been expecting you", filename="say_what.gif")

This example will reproduce the above shell example and save it as "say_what.gif". Feel free to try this example in ipython.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].