Download videos from tiktok and post in:
- facebook page
- youtube shorts
- instagram reels
- tiktok
Project type: client
-
Checks if the current time and date match the publication date configured in the google sheet.
-
Validate the videos in downloads folder with the name or download it from tiktok.
-
Validate the duration of the video for each social network, and made the necessaries file conversions.
Note: each social network have different limits of duration for the videos. If a video is longer than the page limits, it is automatically skipped.
- facebook: 240 minutes
- youtube shorts: 60 seconds
- instagram reels: 60 seconds
- tiktok: 60 seconds
- twitter: 2:20 minutes
Additional, for upload the videos to twitter, they require and extra conversion with the page: https://servicios-web.online-convert.com/es/convertir-para-twitter (This step is done automatically)
-
Post the video in each social network type the tilte, description and tags/keywords.
-
Move the video to done folder.
After post all videos, the google sheet is updated.
By default, youtube have a limit of 15 uploads per day. You can upload more videos with a manually verification. If you try to upload more videos without the verification, the program will raise an error.
For upload reels to instagram, we use the extension INSSIST. At this time, the extension have a bug that allow us to post reels without limits, but when the developers fix it, you will need to pay for the extension to continue using the reels (at the moment, there are no other alternatives).
While the program is running, you will not be able to use your Google Chrome browser Also, make sure that when you start chrome, it opens a new blank tab (not the last open tabs), to avoid errors.
The program automatically replaces the files in the "done" and "downloads" folders. Make sure you don't have any important videos with the same names as the spreadsheet, or you will lose it
This is a web automation project. Web automation depends entirely on the structure of the page, which means that if any social network is updated (for example, facebook) and changes the way videos are uploaded (a structural change (html) with or without changes layout (css)), the project will need to be updated too.
Install all modules from pip:
$ pip install -r requirements.txt
To run the project, the following programs must be installed::
- Google Chrome last version
You can learn how to generate an API Key for google sheets, in this tutorial
You need to create a spreadsheet in the same google account that generated your API Key.
The name of the spreadsheet does not matter, but it is recommended to use "video post" or something similar, to easily identify it
The names of the columns are the following:
Note: all letters must be in lowercase and without spaces or extra characters
- date time
- file or name
- title
- description
- tags
- processed
- uploaded instagram
- uploaded facebook
- uploaded twitter
- uploaded youtube
- uploaded tiktok
Note: more detail about the google sheet in How to use > Google sheet section
This project does not require users and passwords to login, instead it will use the sessions that you already have opened in your browser.
Before running the project, you need to do some extra steeps for prepare your google chrome.
- Login to your instagram account.
- Login to a facebook account how have access for post in the facebook page.
- Login to yout twitter account.
- Login to your youtube account.
- Install the following extensions in chrome: AdBlock y Insist
All configurations are saved in a config.json file, so you can create and edit it manually
This is the content of the file (copy, paste, and replace with your datz):
{
"chrome_folder": "C:\Users\{your user name}\AppData\Local\Google\Chrome\User Data",
"facebook_page": "https://www.facebook.com/your_page_name/?ref=pages_you_manage",
"api_key": "{project folder}\video post\sheets-340407-d8642222c103.json",
"sheet_url": "https://docs.google.com/spreadsheets/d/1Eh1...iw0M/edit?usp=sharing",
"instagram": false,
"facebook": false,
"twitter": true,
"youtube": false,
"tiktok": false
}
The path of google chrome data. By default, in windows, there it in: C:\Users{your user name}\AppData\Local\Google\Chrome\User Data
Path of your google api key in json format, generated in Install > Generate Google API Key section
Link of the google sheet with edit permissions. Here a tutorial about how to generate the link
Link of your facebook page.
Post (true) or skip (false) all the videos for instagram
Post (true) or skip (false) all the videos for facebook
Post (true) or skip (false) all the videos for twitter
Post (true) or skip (false) all the videos for youtube
Post (true) or skip (false) all the videos for youtube
Her the details about howe to use the columns in the google sheet:
Column | description | sample |
---|---|---|
date time | Date and time in which the post should be published. Important: dates must be in chronological order. Format: mm/dd/yyyy h:m | 02/05/2022 18:20 |
url or name | tiktok video link or name of the file in the "downloads" folder (You can use any of the two and the program will detect it automatically) | https://www.tiktok.com/...8670874256902 or video1.mp4 |
title | title of the video to post in all social networks | Dancing |
description | description / caption for add to the video | Hello, this is my first dancing video |
tags | keywords or hashtags, separated by commas | shorts,tiktok,dancing,funny |
processed | status of the video: processed by the program or not. By default, no | yes |
uploaded instagram | if the video is already processed, show if it have been posted in this social network. By default, no | no |
uploaded facebook | if the video is already processed, show if it have been posted in this social network. By default, no | yes |
uploaded twitter | if the video is already processed, show if it have been posted in this social network. By default, no | no |
uploaded youtube | if the video is already processed, show if it have been posted in this social network. By default, no | yes |
uploaded tiktok | if the video is already processed, show if it have been posted in this social network. By default, no | yes |
After do the last steps, you can use the program running the __ main__.py or the project folder with your python 3.9 interpreter.
Only, before of each running, be sure of:
Kill/end from task manager (windows) or htop (linux), all google chrome processes.
Here a tutorial about how to kill google chrome process in windows
To ensure data integrity, do not edit or make changes to the spreadsheet while the program is running.