Skip to content

fearocanity/ebtrfio-template

Repository files navigation

Every (name) Frame in Order BOT

An OpenSource BOT for Facebook Frame in Order
that runs without 24/7 hosting costs

Table of Contents

Tutorial

This section tells how to make it work. In more detailed way.

Note

Grammatical Errors ahead, we're not native english speaker so please bear with us.

Setup Facebook Token

Click Here to Show

To set up a Facebook long-lived access token, follow these steps:

  • Go to Facebook Developer
  • Click My Apps

    Screenshot

  • Click Create App

    Screenshot

  • Click Business and Next(Business has more perks, than others so pick it)

    image

  • This is very Self Explanatory, I guess you already know what to do.

    Screenshot

  • Hover through tools and Click Graph Api Explorer

    Screenshot

  • Grant Permissions for token, Click Add a Permission, Then click Events Groups Pages click all the following Screenshot

[!NOTE] The scopes should be color black as the image shows, If it shows color green it means it's not yet applied to the token. (Repeat the proccess if the next step doesn't work)

  • Click on User Token and choose the page you want.

    Screenshot

  • There's gonna popup there, just give the App Permissions and Authorize it.
  • Now Click Generate Access Token and set the User Token to the page you want, then copy the Short-Lived-Token

    Screenshot

  • Go back to Dashboard Again. Then hover through tools and click Access Token Debugger

    Screenshot

  • Insert the Token you copied earlier and Click Extend Access Token

    Screenshot Screenshot

  • Now Copy it and Save it Somewhere

    Screenshot


Setup the Frames

Click Here to Show

You need to use Windows Powershell to use program called FFMPEG

We need to install Scoop First, before installing FFMPEG

To open Windows Powershell:

  • Click Windows Button
  • And Search for Windows Powershell then Right-Click and click Run as Administrator

After you open it, Run this command:

iwr -useb get.scoop.sh | iex

[!TIP] If theres an error occured, just run the command below and re-run the command above. (Disregard the command below if theres no error appeared)

Set-ExecutionPolicy RemoteSigned -scope CurrentUser

Now Run this command, to install FFMPEG and GIT:

scoop install ffmpeg git

After succeeding, Now run these commands:

md "$($env:USERPROFILE)\Desktop\frames"
cd "$($env:USERPROFILE)\Desktop\frames"

This folder will appear on your Desktop, And thats where you will replace your video you want to chop

image

Now chop the video by running this command:

ffmpeg -i "video.mkv" -r 2 -q:v 3 frame_%00d.jpg
  • -i "video.mkv" input file
  • -r 2 is the frames chopped per second (needed in config.conf)
  • -q:v 3 quality
  • frame_%00d.jpg output file

Wait until it finished...

[!NOTE] This is getting this info is deprecated, no need for you to gather it.

Then, we're gonna gather the infos of Video and Make sure to Take note all the infos needed.

To get the total frames of the video. (You can see this info too while chopping the frames)

ffprobe -v error -select_streams v:0 -count_packets -show_entries stream=nb_read_packets -of csv=p=0 video.mkv

To get the frame rate of the video (If you get fractions "24/1" omit "/1")

ffprobe -v error -select_streams v:0 -show_entries stream=r_frame_rate -of default=noprint_wrappers=1:nokey=1 video.mkv

Then now we're gonna upload the frames to GitHub. Open your Windows Powershell and Run the Command below:

cd ..
git clone https://github.com/{your_username_here}/{repo_name}

[!IMPORTANT] Make sure that you already created a repository for this template. {repo_name} stands for the name of your repo you created for this template

Now, Run this command:

cd {repo_name}
Copy-Item -Path "$($env:USERPROFILE)\Desktop\frames\frame_*.jpg" -Destination frames -Recurse
git init
git add .
git commit -m "frames, update"

Provide your Git Infos, Must be the same as your username and email (it will not display it on public):

git config --global user.name "<your-username>"
git config --global user.email <[email protected]>

Now get your GitHub token, refer to this tutorial...

  • And finally, Push the changes to the repository:
git remote set-url origin https://{your_username}:{your_token_here}@github.com/{your_username}/{repo_name}
git push origin master

Setup your BOT

Click Here to Show

  • Add subtitle file (only supported *.ass/*.ssa, *.srt subtitles)
  • Insert all the infos needed in config.conf file.
    season="1"
    episode="01"
    total_frame="4000" # total frames cutted
    img_fps="" # the fps of the cutted frames
    page_name="" # (must be exact) this is used for checking if the token is valid
  • And push it to master.

We need to setup our repo secret variables too...

  • To setup it, first go to Settings on your GitHub Repo.

    image

  • Under the Secrets and Variables section, Click Actions

    Screenshot

  • Then click New Repository Secret

    Screenshot

  • The name must be TOK_FB, And Paste your Long-Live Facebook you save earlier, Then click Add Secret.

    Screenshot

    • (Optional) You can add the GIF token too by creating again, and it is named TOK_GIF

  • Go to Settings again, Under Actions, click General

    ???

  • Click Read and Write Permission and save it.

    ???

  • Then you're good to go for a test now. You're Done!!


How to make your Content Public

Important

All the contents you post will not be shown to public if it not set to Live

Click Here to Show

  • Go to Settings > Basic

    Screenshot

  • And Change your Privacy Policy URL to https://google.com, Then click Save Changes at the bottom of the page.

    Screenshot Screenshot

  • Then go back to the Dashboard and Switch your Transparency from Development to Live

    Screenshot


How to Run the Bot Manually

Click Here to Show

  • Click on Actions

    image

  • Click on init banner, And click Run Workflow

    Screenshot

[!CAUTION] We prefer not doing this (The BOT is already running), because it will cause to run the workflow twice when the automatic run was executed. it'll cause duplication. Instead do Manually Disable Workflow. Make sure you know what you're doing. (This is helpful if you want to run the posting after you enable the workflow)


How to Manually Enable/Disable the Posting

Click Here to Show

  • Click on Actions

    image

  • Click on init banner, and click the three dots ···. Then finally, click on Disable Workflow

    Screenshot

[!TIP] Enabling it pretty much the same procedure, It will appear the enable button at the top.


How to Change the Interval execution of Posting

Click Here to Show

  • Firstly, go to .github/workflows/process.yml Screenshot

  • And change the cron syntax 0 */2 * * *, this cron syntax stands for every 2 hrs, so you can just change the 2 based on your likings. Or you can make your own cron here.

[!CAUTION] Make sure you know what you're doing, This might cause duplications and errors on posting. And before you adjust it, make sure the product of fph and mins mustn't exceed to the number of hours you set on cron. Assume you have fph=50 and mins=5, so the product of it is: 50 * 5 = 250, then divide it with 60 to know the number of hours: 250 / 60 = 4.16 hrs

Notes and Tips

Tip

  • By Default, the bot will automatically run every 2 hrs. (This is our Standard Interval posting)
  • We recommend to use Use this Template button rather than forking this repository.
  • We recommend Creating a Pull Request when you're setupping frames for next episode/series to track your changes and guides you on what steps you will take.
  • Make sure not to push something in master while the BOT is running. Wait it to be finished first to avoid duplicatiom issues.
  • Keep your repository updated with parent repository for fixes and security measure updates.
  • When proceeding to a new Episode, you should create a Pull Request to your repo. (Don't forget frameiterator to change back to 1)
  • Use action/repo-checker as your basis for checking errors and misconfiguration.
  • Recommended source: Erai-Raws, Nyaa.
  • If you need help, just message us on our Facebook page. Or create an Issue/Discussion thread here.
  • When using a VPS/Droplet server, just clone this repository and paste all your frames to frames directory, also the tokens are gonna be in secret.sh file.

Warning

We're not responsible whatever happens to your Facebook account. Just to be safe, I prefer using an dedicated account for the page, else you can use your main but use it with care. Use at your own risk

Contributing

+ All PR's are now welcome!! +

If you have ideas or fixes to the bugs and also improving the codes, Feel free to Contribute! 😉

Status

Status Image