Thanks to visit codestin.com
Credit goes to github.com

Skip to content

akhramov/append

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Appender

Well, what is it?

A reddit bot, which appends videos to posts, written in Rust.

A good use-case would be the appending closing credit to the end of the posted video.

How do I build it?

You will need cargo.

% cargo build --release

Run-time dependencies are libsqlite & ffmpeg (binary).

How do I use it?

Typically, just schedule the program launch via cron for, say, every 2 minutes and you are good to go.

Supported video-hostings.

This version of bot supports these video-hosting platforms:

  • Imgur
  • Gfycat
  • Reddit hosted-videos.

Converted videos are uploaded to Imgur.

Configuration?

Appender is configurable via env-variables. All variables are mandatory.

VariableDescriptionExample
VIDEO_TO_APPENDPath to the video to be appended to the posted videos/usr/home/video.mp4
FFMPEG_BINARYPath to ffmpeg binary/usr/bin/ffmpeg
IMGUR_CLIENT_IDImgur client id, visit https://apidocs.imgur.com/?version=latest#authentication for more details
IMGUR_UPLOAD_URLhttps://api.imgur.com/3/upload
REDDIT_AUTH_TOKENReddit auth token (https://github.com/reddit-archive/reddit/wiki/OAuth2)
REDDIT_AUTH_URLhttps://www.reddit.com/api/v1/access_token
REDDIT_COMMENT_URLhttps://oauth.reddit.com/api/comment
REDDIT_PM_URLhttps://oauth.reddit.com/api/compose
REDDIT_USERNAMEBot usernameclosing_credits_bot
REDDIT_PASSWORDBot password
BOT_USER_AGENTReddit requires bots to set a uniq user-agent. Try your best!
COMMENT_TEXTText that goes before the link.Here’s your link.
PM_TEXTSometimes, mods ban bots. Nonetheless, we can PM comment the author.Here’s your link.
PM_SUBJECTYour gif url.
DATABASE_URLPath to sqlite DB
UPDATES_URLhttps://api.pushshift.io/reddit/search/comment
POSTS_URLhttps://api.pushshift.io/reddit/submission/search
TRIGGER_STRINGThe comment string, which will trigger the bot.u/closing_credits_bot
DOWNLOADS_DIRECTORYWhere do we store downloads?/tmp/appender-data
GFYCAT_POST_ENDPOINThttps://api.gfycat.com/v1/gfycats/

Acknowledgments

This bot is a simple wrapper around FFMPEG and pushshift.

Pushshift provides both historical & real-time reddit data, queryable with elasticsearch.

https://pushshift.io/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages