Giter VIP home page Giter VIP logo

frame-in-order's Introduction

Every Frame in Order Bot

This is tool i use to run my: Every Charlotte Frame in Order, Every BanG Dream Frame in Order Facebook Fanspage.

Tested in Debian with Python 3.10.8.

Preparation

First, you need to extract all frames from video into frames folder. You can use ffmpeg for this.

Example, if you have Charlotte_episode2.mp4 on videos folder, you can run this command.

mkdir frames
ffmpeg -i 'videos/Charlotte_episode2.mp4' -vf fps=1 ./frames/%04d.png -hide_banner

Frame Extract

Your extracted frames will named 0001.png, 0002.png, etc. Example:

ryzen@raspberrypi:~$ ls -lha ./frames/ | head -n 8
total 49M
drwxr-xr-x 2 ryzen ryzen 4.0K Mar 13 17:51 .
drwxr-xr-x 5 ryzen ryzen 4.0K Mar 13 17:51 ..
-rw-r--r-- 1 ryzen ryzen 7.0M Mar 13 17:51 0001.png
-rw-r--r-- 1 ryzen ryzen 8.1M Mar 13 17:51 0002.png
-rw-r--r-- 1 ryzen ryzen 8.2M Mar 13 17:51 0003.png
-rw-r--r-- 1 ryzen ryzen 5.5M Mar 13 17:51 0004.png
-rw-r--r-- 1 ryzen ryzen 5.5M Mar 13 17:51 0005.png

Frames Folder

If you need to delete opening images, ending images, or some images from frames directory, you need to reorder the file name again. Use this command:

cd frames
ls -v | grep '.png' | cat -n | while read new old; do mv -n "$old" `printf "%04d.png" $new`; done

Setup Application and Token

First, create your apps in Facebook Developer. Next, get your token at Graph API Explorer. And then, extend your token expiration at Access Token Debugger.

Setup Bot

Ok, all frames is ready to upload. Next, ajjust some value from run.py.

Change value of ACCESS_TOKEN with your token.

To avoid your application blocked (because of spam detection), i am adding MIN_DELAY and MAX_DELAY on every requests . You can change to your desired value but remember, dont set below 3 min (180 sec) because Facebook can limit your page and flag it as Spam.

In my case, for 1 Episode of Charlotte, around 1.5GB disk will be used for extracted frames. So, this tool will remove every frame that already uploaded to freed your disk space.

Run Bot

After all is completed, just run Frame in Order bot with this command:

python3 run.py --start 1

And if you want to continue running again, start from frame 41.

python3 run.py --start 41

Example of output: Charlotte Frames in Order

Default loop value is unlimited. But you can set loop value using --loop flag. Example:

python3 frame-in-order.py --start 41 -loop 4

Above command will upload frame from 0041.png until 0045.png.

Contact

If you have any question about this Bot, you can contact me directly on Facebook.

frame-in-order's People

Contributors

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