This section tells how to make it work in Step-by-Step process and in more detailed way.
- Setup FB Token
- Setup Frames
- Setup your BOT
- How to make your Content Public
- How to Run the Bot Manually
- How to Manually Disable the Posting
Note
Grammatical Errors ahead, we're not native english speaker so please bear with us.
Click Here to Show
To set up a Facebook long-lived access token, follow these steps:
- Go to Facebook Developer
- Click
My Apps
- Click
Create App
- Click
Business
andNext
(Business has more perks, than others so pick it) - This is very Self Explanatory, I guess you already know what to do.
- Hover through
tools
and ClickGraph Api Explorer
- Grant Permissions for token, Click
Add a Permission
, Then clickEvents Groups Pages
click all the following
The scopes should be color
black
as the image shows, If it shows colorgreen
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. - There's gonna popup there, just give the App Permissions and Authorize it.
- Now Click
Generate Access Token
and set theUser Token
to the page you want, then copy the Short-Lived-Token - Go back to
Dashboard
Again. Then hover throughtools
and clickAccess Token Debugger
- Insert the Token you copied earlier and Click
Extend Access Token
- Now Copy it and Save it Somewhere
Click Here to Show
tip You can use a graphical interface to extract frames, Frame Chopper or follow the steps below.
You need to use Windows PowerShell to install and use FFMPEG
Before installing FFMPEG
, we need to install Scoop, a package manager for Windows
Step 1: Open Windows Powershell
:
- Click the
Windows Button
(Start Menu). - And Search for
Windows Powershell
then Right-Click and clickRun as Administrator
Step 2: Set the Execution Policy (First Time Only)
- If this is your first time running remote scripts, you'll need to allow PowerShell to execute them. Run the following command to set the execution policy
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
If you encounter an error, re-run the command above, and then proceed with the next steps
Step 3: Install Scoop
- Now, install Scoop by running this command:
iwr -useb get.scoop.sh | iex
Step 4: Install FFMPEG
and GIT
Once Scoop is installed, run the following command:
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
Now chop the video by running this command:
ffmpeg -i "video.mkv" -vf "fps=2" -fps_mode vfr -q:v 3 frame_%00d.jpg
-i "video.mkv"
Specifies the input video file-vf "fps=2"
is the frames chopped per second (needed inconfig.conf
)-fps_mode vfr
Ensures variable frame rate is used to match the input video-q:v 3
Defines the output image quality (lower numbers mean higher quality)frame_%00d.jpg
Specifies the output file naming pattern (e.g., frame_1.jpg, frame_2.jpg)
Wait until it finished...
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
Create your own clone of the repository. And click Create a new Repository
, You will be redirected to create the name of your repository. And the steps of creating one should be self-explanatory.
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}
{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
Click Here to Show
- Add subtitle file (only supported *.ass/*.ssa, *.srt subtitles)
- Insert all the infos needed in
config.conf
file.Lines 4 to 8 in 039f6e9
- 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. -
Under the
Secrets and Variables
section, ClickActions
-
Then click
New Repository Secret
-
The name must be
TOK_FB
, And Paste your Long-Live Facebook you save earlier, Then clickAdd Secret
.- (Optional) You can add the GIF token too by creating again, and it is named
TOK_GIF
- (Optional) You can add the GIF token too by creating again, and it is named
-
Add also your GitHub token on Repository Secrets named
GIT_TOK
Important
All the contents you post will not be shown to public if its NOT set to Live
Click Here to Show
Click Here to Show
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)
Click Here to Show
- Click on
Actions
- Click on
Trigger
, and click the three dots···
. Then finally, click onDisable Workflow
Enabling it pretty much the same procedure, It will appear the enable button at the top.
Click Here to Show
-
And change the cron syntax
0 */2 * * *
, this cron syntax stands forevery 2 hrs
, so you can just change the2
based on your likings. Or you can make your own cron here.
: 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
andmins
mustn't exceed to the number of hours you set on cron. Assume you havefph=50
andmins=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