haroldao / TiktokAutoUploader

Automatically Edits Videos and Uploads to Tiktok with 1 line of code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TiktokAutoUploader v1.3

Automatically Edits Videos and Uploads to Tiktok with 1 line of code.


Setup

pip install -r requirements.txt

pip install git+https://github.com/pytube/pytube

Have you installed ImageMagick on your system,

https://imagemagick.org/script/download.php

Then in site-packages, go to moviepy and edit config_defualts.py

image

Change this auto to your path like shown in image above.


Parameters

method uploadVideo(video_dir, videoText, startTime=0, endTime=0, private=True, test=False)

By defualt test=False meaning it will upload and not stay preview for user to click upload.

Switching to test=True, it will allow you to preview.


Notes

Please use chromedriver.exe provided as its source code has been edited to avoid bot detection on tiktok website.

Use only tiktok accounts that can be accessed through email password on browser, OAuth2.0 may not work, slightly probable.

Do not spam upload videos as tiktok will most likely ban you after this or during the act.

I am not responsible/ liable for any damages or problems or resulting effects you face using this tool or in relation with this tool, use at own risk.

Webdriver selected classes that are most likely not going to change in a while, looking for alternatives.

If you have any issues or errors with pytube, please use pip install git+https://github.com/pytube/pytube instead of pip install pytube3, as that is usually slow to update from githup repo.


Basic Usage Example

if name == "main":

# Example Usage

tiktok_bot = TiktokBot()

# Use a video from your directory.

tiktok_bot.upload.uploadVideo("test1.mp4", "This is text \n overlay on \n the video", 1, 45)

# Or use youtube url as video source. [Simpsons Meme 1:16 - 1:32 Example]

tiktok_bot.upload.directUpload("test.mp4", private=True, test=True)

tiktok_bot.upload.uploadVideo("https://www.youtube.com/watch?v=OGEouryaQ3g", "TextOverlay", startTime=76, endTime=92, private=False)

Image Overlay Feature

image

positioning


Example Video

demo.mp4

Issues Fixed

Previously the code had a lot of problems with many things when reviewing again:

-> Files were read and being overwritten at same time, leading to corrupt and sometimes frozen video outputs.

-> Sometimes when extracting youtube videos, there may not be audio available and so will continue regardless.

-> The video dimensions never fit the tiktok recommended dims and so was obscured when uploaded.

-> The layout for captions on the video and overall format of the video was not nice to look at.

-> Cropping videos did not work properly most of the time.

All these issues have now been fixed.


Updated Fixes and new features


-> Now you can add multiple tiktok accounts, simple to use prompts.

-> You can now choose not to add a caption to the video without errors.


Current Problems:
-> Design and layout of classes was not thought out as well and so left it very messy and not structured well.

TODO:
-> Allow users to add schedule video uploads using CSV file.

-> Improve structuring of code and design better one.

-> Maybe add a GUI?

-> Allow direct uploading of videos.


About

Automatically Edits Videos and Uploads to Tiktok with 1 line of code.

License:GNU General Public License v3.0


Languages

Language:Python 100.0%