All Projects → pmdevita → GifReversingBot

pmdevita / GifReversingBot

Licence: other
A Reddit bot that reverses gifs

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to GifReversingBot

fissure-android
Android application for generating GIFs on the go
Stars: ✭ 21 (-44.74%)
Mutual labels:  gif
context-mod
an event-based, reddit moderation bot built on top of snoowrap and written in typescript
Stars: ✭ 38 (+0%)
Mutual labels:  reddit-bot
StbSharp
C# port of the famous C framework
Stars: ✭ 62 (+63.16%)
Mutual labels:  gif
abeamer
frame-by-frame Web Animation framework
Stars: ✭ 49 (+28.95%)
Mutual labels:  gif
xaringanBuilder
An R package for building xaringan slides into multiple outputs, including html, pdf, png, gif, pptx, and mp4.
Stars: ✭ 157 (+313.16%)
Mutual labels:  gif
ios-nd-gif-maker-swift
Resources for Udacity's Gif Maker app in Swift.
Stars: ✭ 13 (-65.79%)
Mutual labels:  gif
iOSUtilitiesSource
IOS Utilities Library for Swift
Stars: ✭ 46 (+21.05%)
Mutual labels:  gif
vex
reverse HTTP proxy tunnel via secure SSH connections.
Stars: ✭ 20 (-47.37%)
Mutual labels:  reverse
View-Load-ReTry
这个加载框架有点不一样,针对View进行加载,加载页面还保持了原View的属性,侧重点在灵活,哪里需要加载哪里,加载状态页面完全自定义,无任何限制,针对加载结果可以按需配置对应页面,LeakCanary检测无内存泄漏
Stars: ✭ 116 (+205.26%)
Mutual labels:  gif
akamai-toolkit
A set of tools to work on Akamai v1 anti-bot solution. Current supported version: 1.70
Stars: ✭ 215 (+465.79%)
Mutual labels:  reverse
scripts
A collection of random scripts I coded up
Stars: ✭ 17 (-55.26%)
Mutual labels:  gif
xvcode
web dynamic validation code generator 动态web校验码图片生成
Stars: ✭ 43 (+13.16%)
Mutual labels:  gif
gfxprim
Open-source modular 2D bitmap graphics library with emphasis on speed and correctness.
Stars: ✭ 32 (-15.79%)
Mutual labels:  gif
webgif
Easily generate animated GIFs from websites
Stars: ✭ 98 (+157.89%)
Mutual labels:  gif
gif-player
Control your animated GIFs
Stars: ✭ 120 (+215.79%)
Mutual labels:  gif
PixelShape
Pixel editor that comes in handy when creating pixel art images and animations
Stars: ✭ 29 (-23.68%)
Mutual labels:  gif
AnyImageKit
A toolbox for pick/edit/capture photo or video. Written in Swift.
Stars: ✭ 580 (+1426.32%)
Mutual labels:  gif
togglific
Do you find web animations distracting? Togglific provides a distraction-free web experience!
Stars: ✭ 17 (-55.26%)
Mutual labels:  gif
sail
The missing small and fast image decoding library for humans (not for machines) ⛵ https://sail.software
Stars: ✭ 206 (+442.11%)
Mutual labels:  gif
gogif
The (no longer) missing GIF encoder for #golang
Stars: ✭ 21 (-44.74%)
Mutual labels:  gif

GifReversingBot

Reddit bot that reverses gifs. Currently running under /u/gifreversingbot.

Setup

Create a file named credentials.ini in the root directory with the following content

[general]
mode = development|production
operator = username to be pinged on crash/other stuff

[database]
type = sqlite|mysql
# Settings for mysql
host = 
username =
password = 
database =

[reddit]
client_id = Reddit client id
client_secret = Reddit client secret
username = Reddit username
password = Reddit password

[imgur]
imgur_id = Imgur api id
imgur_secret = Imgur api secret
imgur_cookie = Cookie generated from an Imgur upload

[gfycat]
gfycat_id = gftcat id
gfycat_secret = gfycat secret

[streamable]
email = streamable account email
password = password

[catbox]
hash = your catbox account hash

From there run python main.py from the root directory to start. GifReversingBot requires Python 3.6+.

You will also need FFmpeg, FFprobe, and gifski binaries on the path or in the same directory.

Commentary

Here's some notes on the more interesting parts of the bot.

Context detection

The bot goes through a couple of steps to determine what the user was asking for. First thing it checks is whether or not the user gave a link in the summon comment themselves. Then it looks through the comment chain to see if there was a gif in the parent comments (it will choose the one last referenced in the chain). Finally, it checks the post for a link.

The bot recognizes "re-reverses" (wherein someone tries to have the bot reverse it's own gif) when it encounters it's own comment while searching through parent comments. When this happens, it searches up the chain a bit farther to find the original link and replies with that.

Reversing gifs/mp4s

GifReversingBot uses two different reversing procedures which it chooses based on a few different circumstances. If it is reversing an mp4 (which is the most common gif type nowadays, go figure), it does the reversal process with FFmpeg. For gifs, it exports each frame with FFmpeg and then reassembles them with gifski. Although gifski produces great gifs, it's very slow and so this process is usually avoided. The bot chooses a reversal method by making an educated guess as to whether the source was originally a gif or an mp4.

Gif Host Library

v3 of GifReversingBot introduces the new Gif Host Library, a new implementation of the code used to describe gifs and hosting websites. It aims to share as much code as possible between the sites, reducing implementation efforts as well as surface area for bugs. Hosts define several properties such as how to parse their links, upload capabilities,and limits. Instead of hard coding where the bot should upload gifs for every host, it is now decided dynamically through the properties of a gif, limits of the hosting sites, and other priorities. It's fairly sturdy even though it's new and abstracts away many annoyances, differences, and difficulties managing the gif host sites.

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