This bot creates quranic clips using Remotion and uploads them to TikTok using the Content Posting API.
- Node.js 20 or above, with
pnpm@9.9.0
. - Remotion Linux Dependencies.
- Python 3 (with all dependencies from the
./scripts
folder). - TikTok developers App.
- Rename
.env.sample
file to.env
and fill your TikTok secrets and your Cloudinary URL.
Important
You need to get your own TikTok refresh token by adding your personal account to your App sandbox and following the right steps. See User Access Token Management.
- Install the node dependencies using:
pnpm install
- Install python dependencies using:
python3 -m pip install yt-dlp
pip3 install cloudinary
pip3 install python-dotenv
- Install Chrome headless shell for remotion using:
pnpm remotion:chrome
- Download the croma by creating a
.txt
that containes a croma video link from youtube on each line, and then use it with this command:
python3 scripts/download-youtube-videos.py file.txt assets/croma
- Download the backgrounds by doing the same thing with a different
.txt
file, and then use it with this command:
python3 scripts/download-youtube-videos.py file2.txt assets/background
- Upload all the assets to Cloudinary by running:
python3 scripts/upload-videos.py assets/croma
python3 scripts/upload-videos.py assets/background
-
You will use Remotion to create your videos, all the code will be in
/remotion
folder, you can read more about it from their official documentation. -
Start your local remotion studio by running:
pnpm remotion:studio
- Render your video to
out/video.mp4
using:
pnpm remotion:render
- if you want to generate props based on your Cloudinary assets, use:
node scripts/download-assets.js
pnpm remotion:render
After you render the video.mp4
, you can upload it using:
pnpm upload
Note
You will find your uploaded video in your Inbox in the System notifications ready for posting.
Warning
Ensure you post the videos after uploading or don't upload more than 5 videos within 24 hours, otherwise, you'll get a spam risk error. See spam_risk_too_many_pending_share error.
Important
Don't forget to add your .env
variables to your GitHub secrets before launching any workflow.
Distributed under the MIT license.