Skip to content

This is a TikTok Quran bot built using node.js and react with Remotion with GitHub action schedule workflow.

License

Notifications You must be signed in to change notification settings

malkiii/quran-tiktok-bot

Repository files navigation

📱 TikTok Quran bot

This bot creates quranic clips using Remotion and uploads them to TikTok using the Content Posting API.

📋 Requirements

💻 Local Setup

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

  1. Install the node dependencies using:
pnpm install
  1. Install python dependencies using:
python3 -m pip install yt-dlp
pip3 install cloudinary
pip3 install python-dotenv
  1. Install Chrome headless shell for remotion using:
pnpm remotion:chrome

📥 Downloading Assets

  1. 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
  1. 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
  1. Upload all the assets to Cloudinary by running:
python3 scripts/upload-videos.py assets/croma
python3 scripts/upload-videos.py assets/background

🎬 Start Creating videos

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

  2. Start your local remotion studio by running:

pnpm remotion:studio
  1. Render your video to out/video.mp4 using:
pnpm remotion:render
  1. if you want to generate props based on your Cloudinary assets, use:
node scripts/download-assets.js
pnpm remotion:render

🚀 Upload to TikTok

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.

🤖 Using GitHub Actions

Important

Don't forget to add your .env variables to your GitHub secrets before launching any workflow.

📄 Project License

Distributed under the MIT license.