Giter Club home page Giter Club logo

tiktok-uploader's Introduction

video working

⬆️ TikTok Uploader

A Selenium-based automated TikTok video uploader

English · Chinese (Simplified) · French · Spanish · German

Forks Stars Watchers

Table of Contents

Installation

A perquisite to using this program is the installation of a Selenium-compatible web browser. Google Chrome is recommended.

MacOS, Windows and Linux

Install Python 3 or greater from python.org

Downloading from PyPI (Recommended)

Install tiktok-uploader using pip

pip install tiktok-uploader

Building from source

Installing from source allows greater flexibility to modify the module's code to extend default behavior.

First, clone and move into the repository. Next, install hatch, the build tool used for this project 1. Then, build the project. Finally, install the project with the -e or editable flag.

git clone https://github.com/wkaisertexas/tiktok-uploader.git
cd tiktok-uploader
pip install hatch
hatch build
pip install -e .

Usage

tiktok-uploader works by duplicating your browser's cookies which tricks TikTok into believing you are logged in on a remote-controlled browser.

💻 Command Line Interface (CLI)

Using the CLI is as simple as calling tiktok-uploader with your videos: path (-v), description(-d) and cookies (-c)

tiktok-uploader -v video.mp4 -d "this is my escaped \"description\"" -c cookies.txt
from tiktok_uploader.upload import upload_video, upload_videos
from tiktok_uploader.auth import AuthBackend

# single video
upload_video('video.mp4',
            description='this is my description',
            cookies='cookies.txt')

# Multiple Videos
videos = [
    {
        'path': 'video.mp4',
        'description': 'this is my description'
    },
    {
        'path': 'video2.mp4',
        'description': 'this is also my description'
    }
]

auth = AuthBackend(cookies='cookies.txt')
upload_videos(videos=videos, auth=auth)

⬆ Uploading Videos

This library revolves around the upload_videos function which takes in a list of videos which have filenames and descriptions and are passed as follows:

from tiktok_uploader.upload import upload_videos
from tiktok_uploader.auth import AuthBackend

videos = [
    {
        'video': 'video0.mp4',
        'description': 'Video 1 is about ...'
    },
    {
        'video': 'video1.mp4',
        'description': 'Video 2 is about ...'
    }
]

auth = AuthBackend(cookies='cookies.txt')
failed_videos = upload_videos(videos=videos, auth=auth)

for video in failed_videos: # each input video object which failed
    print(f'{video['video']} with description "{video['description']}" failed')

🫵 Mentions and Hashtags

Mentions and Hashtags now work so long as they are followed by a space. However, you as the user are responsible for verifying a mention or hashtag exists before posting

Example:

from tiktok_uploader.upload import upload_video

upload_video('video.mp4', '#fyp @icespicee', 'cookies.txt')

🪡 Stitches, Duets and Comments

To set whether or not a video uploaded allows stitches, comments or duet, simply specify comment, stitch and/or duet as keyword arguments to upload_video or upload_videos.

upload_video(..., comment=True, stitch=True, duet=True)

Comments, Stitches and Duets are allowed by default

🌐 Proxy

To set a proxy, currently only works with chrome as the browser, allow user:pass auth.

# proxy = {'user': 'myuser', 'pass': 'mypass', 'host': '111.111.111', 'port': '99'}  # user:pass
proxy = {'host': '111.111.111', 'port': '99'}
upload_video(..., proxy=proxy)

📆 Schedule

The datetime to schedule the video will be treated with the UTC timezone.
The scheduled datetime must be at least 20 minutes in the future and a maximum of 10 days.

import datetime
schedule = datetime.datetime(2020, 12, 20, 13, 00)
upload_video(..., schedule=schedule)

🔐 Authentication

Authentication uses your browser's cookies. This workaround was done due to TikTok's stricter stance on authentication by a Selenium-controlled browser.

Your sessionid is all that is required for authentication and can be passed as an argument to nearly any function

🍪 Get cookies.txt makes getting cookies in a NetScape cookies format.

After installing, open the extensions menu on TikTok.com and click 🍪 Get cookies.txt to reveal your cookies. Select Export As ⇩ and specify a location and name to save.

upload_video(..., cookies='cookies.txt')

Optionally, cookies_list is a list of dictionaries with keys name, value, domain, path and expiry which allow you to pass your own browser cookies.

Example:

cookies_list = [
    {
        'name': 'sessionid',
        'value': '**your session id**',
        'domain': 'https://tiktok.com',
        'path': '/',
        'expiry': '10/8/2023, 12:18:58 PM'
    },
    # the rest of your cookies all in a list
]

upload_video(..., cookies_list=cookies_list)

👀 Browser Selection

Google Chrome is the preferred browser for TikTokUploader. The default anti-detection techniques used in this packaged are optimized for this. However, if you wish to use a different browser you may specify the browser in upload_video or upload_videos.

from tiktok_uploader.upload import upload_video

from random import choice

BROWSERS = [
    'chrome',
    'safari',
    'chromium',
    'edge',
    'firefox'
]

# randomly picks a web browser
upload_video(..., browser=choice(BROWSERS))

✅ Supported Browsers:

  • Chrome (Recommended)
  • Safari
  • Chromium
  • Edge
  • FireFox

🚲 Custom WebDriver Options

Default modifications to Selenium are applied which help it avoid being detected by TikTok.

However, you may pass a custom driver configuration options. Simply pass options as a keyword argument to either upload_video or upload_videos.

from selenium.webdriver.chrome.options import Options

options = Options()

options.add_argument('start-maximized')

upload_videos(..., options=options)

Note: Make sure to use the right selenium options for your browser

🤯 Headless Browsers

Headless browsing only works on Chrome. When using Chrome, adding the --headless flag using the CLI or passing headless as a keyword argument to upload_video or upload_videos is all that is required.

upload_video(..., headless=True)
upload_videos(..., headless=True)

🔨 Initial Setup

WebDriverManager is used to manage driver versions.

On initial startup, you may be prompted to install the correct driver for your selected browser. However, for Chrome and Edge the driver is automatically installed.

♻ Examples

📝 Notes

This bot is not fool proof. Though I have not gotten an official ban, the video will fail to upload after too many uploads. In testing, waiting several hours was sufficient to fix this problem. For this reason, please think of this more as a scheduled uploader for TikTok videos, rather than a spam bot.

Accounts made with

  • @C_Span - A split-screen channel with mobile games below-featuring clips from C-Span's YouTube channel
  • @habit_track - A Reddit bot to see which SubReddit is most viral on TikTok

If you like this project, please ⭐ it on GitHub to show your support! ❤️

Star History Chart

Footnotes

  1. If interested in Hatch, checkout the website

tiktok-uploader's People

Contributors

blackdede avatar csrgxtu avatar enzorsl avatar erdem093 avatar gqmv avatar hadicya avatar misterneo avatar paillat-dev avatar wkaisertexas avatar xavierzambrano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tiktok-uploader's Issues

Failed to add cookie

Hello,

I exported the cookie informations and started with the basic example

from tiktok_uploader.upload import upload_video

cookies_list = [
    {
        'name': 'sessionid',
        'value': '<session_id>',
        'domain': '.tiktok.com',
        'path': '/',
        'expiry': "3/7/2024, 10:21:30 PM"
    }
]

if __name__ == "__main__":

    # upload video to TikTok
    upload_video("clip.mp4",
                 browser="firefox",
                 description="This is a video I just downloaded",
                 cookies_list=cookies_list)
[17:24:09] Authenticating browser with cookies_list
[17:24:09] Create a firefox browser instance 
[17:24:13] Authenticating browser with cookies
[17:24:15] Failed to add cookie {'name': 'sessionid', 'value': '<session_id>', 'domain': '.tiktok.com', 'path': '/', 'expiry': '3/7/2024, 10:21:30 PM'}
[17:24:15] Posting clip.mp4
               with description: This is a video I just downloaded
[17:24:15] Navigating to upload page

It failed adding the cookie, is there anyone having the same issues?

ModuleNotFoundError: No module named 'tiktok_uploader'

Hello,
When I execute the program.it is error. Can you help me,please?

tiktok-uploader -v my_video.mp4 -d "this is my escaped "description"" -c www.tiktok.com_cookies.txt
Traceback (most recent call last):
File "c:\users\cheersgo\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "c:\users\cheersgo\appdata\local\programs\python\python37\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\cheersgo\AppData\Local\Programs\Python\Python37\Scripts\tiktok-uploader.exe_main
.py", line 4, in
ModuleNotFoundError: No module named 'tiktok_uploader'
5545

Unable to locate element: {"method":"xpath","selector":"//input[@type='file']"}

Hey It´s me again,
I have been following all the documentation + checking 'example_series_upload.py' but when I'm trying to upload a video I have the following error:

WDM] - Downloading: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.80M/6.80M [00:00<00:00, 39.4MB/s]

DevTools listening on ws://127.0.0.1:61368/devtools/browser/50440715-fb1f-4b21-b1b2-c93e21d70d86
[19812:23244:0414/191704.168:ERROR:cert_issuer_source_aia.cc(34)] Error parsing cert retrieved from AIA (as DER):
ERROR: Couldn't read tbsCertificate as SEQUENCE
ERROR: Failed parsing Certificate

Upload exception: Message: 
Stacktrace:
Backtrace:
        GetHandleVerifier [0x011EDCE3+50899]
        (No symbol) [0x0117E111]
        (No symbol) [0x01085588]
        (No symbol) [0x010B08F9]
        (No symbol) [0x010B0AFB]
        (No symbol) [0x010DF902]
        (No symbol) [0x010CB944]
        (No symbol) [0x010DE01C]
        (No symbol) [0x010CB6F6]
        (No symbol) [0x010A7708]
        (No symbol) [0x010A886D]
        GetHandleVerifier [0x01453EAE+2566302]
        GetHandleVerifier [0x014892B1+2784417]
        GetHandleVerifier [0x0148327C+2759788]
        GetHandleVerifier [0x01285740+672048]
        (No symbol) [0x01188872]
        (No symbol) [0x011841C8]
        (No symbol) [0x011842AB]
        (No symbol) [0x011771B7]
        BaseThreadInitThunk [0x75DB0099+25]
        RtlGetAppContainerNamedObjectPath [0x772C7B6E+286]
        RtlGetAppContainerNamedObjectPath [0x772C7B3E+238]

Upload exception: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='file']"}
  (Session info: chrome=112.0.5615.86)
Stacktrace:
Backtrace:
        GetHandleVerifier [0x011EDCE3+50899]
        (No symbol) [0x0117E111]
        (No symbol) [0x01085588]
        (No symbol) [0x010B08F9]
        (No symbol) [0x010B0AFB]
        (No symbol) [0x010DF902]
        (No symbol) [0x010CB944]
        (No symbol) [0x010DE01C]
        (No symbol) [0x010CB6F6]
        (No symbol) [0x010A7708]
        (No symbol) [0x010A886D]
        GetHandleVerifier [0x01453EAE+2566302]
        GetHandleVerifier [0x014892B1+2784417]
        GetHandleVerifier [0x0148327C+2759788]
        GetHandleVerifier [0x01285740+672048]
        (No symbol) [0x01188872]
        (No symbol) [0x011841C8]
        (No symbol) [0x011842AB]
        (No symbol) [0x011771B7]
        BaseThreadInitThunk [0x75DB0099+25]
        RtlGetAppContainerNamedObjectPath [0x772C7B6E+286]
        RtlGetAppContainerNamedObjectPath [0x772C7B3E+238]

Upload exception: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='file']"}
  (Session info: chrome=112.0.5615.86)
Stacktrace:
Backtrace:
        GetHandleVerifier [0x011EDCE3+50899]
        (No symbol) [0x0117E111]
        (No symbol) [0x01085588]
        (No symbol) [0x010B08F9]
        (No symbol) [0x010B0AFB]
        (No symbol) [0x010DF902]
        (No symbol) [0x010CB944]
        (No symbol) [0x010DE01C]
        (No symbol) [0x010CB6F6]
        (No symbol) [0x010A7708]
        (No symbol) [0x010A886D]
        GetHandleVerifier [0x01453EAE+2566302]
        GetHandleVerifier [0x014892B1+2784417]
        GetHandleVerifier [0x0148327C+2759788]
        GetHandleVerifier [0x01285740+672048]
        (No symbol) [0x01188872]
        (No symbol) [0x011841C8]
        (No symbol) [0x011842AB]
        (No symbol) [0x011771B7]
        BaseThreadInitThunk [0x75DB0099+25]
        RtlGetAppContainerNamedObjectPath [0x772C7B6E+286]
        RtlGetAppContainerNamedObjectPath [0x772C7B3E+238]

It's really strange because it uploads the video but doesn't change the Caption + Doesn't click to post.
Any tip on that? I was trying to check as well on my browser the selector":"//input[@type='file']" inside the webpage and I didn't find it. Maybe they have changed that?

i can't use it

i type
tiktok-uploader \ -v video.mp4 \ -c cookies.txt
and recieve
usage: tiktok-uploader [-h] -v VIDEO [-d DESCRIPTION] [-c COOKIES] [-u USERNAME] [-p PASSWORD] [--headless] tiktok-uploader: error: unrecognized arguments: \ \

Adding newline or unicode characters to description does some funky stuff

I accidentally forgot to clean my input and a the input contained a couple '\n'. I watched the browser (firefox) as when it approached the typing of the new line character it moved the cursor back to the beginning of the description about 3 characters in, producing an output description like this:

Check out this cool recipe!\n#cooking #cook #cookingusa

Che#cooking #cook #cookingusack out this cool recipe!

Managed to fix it by just removing the newline and other weird characters. Maybe do that by default?

Is there a way to authenticate the user without cookies?

Quick question,
I am always using the cookies.txt file and works great, but I was wondering if there is another way of login. I have seen that using user and password if kind of hard because of the anti-captcha thing.
Thanks in advance!!

works on linux console?

Can it be used on a console that uses linux? I currently use it to upload a video daily from a server that only uses a console and is a linux distribution but it gives me an error when executing it

contact me

hey
i want to talk to you about something
Telegram: @vindyz
Discord: Vindyz

Add compatibility with Raspberry Pi and a potential issue

Hi there,
I have been using your product and I think it's great! However, I noticed that it's not compatible with Raspberry Pi 4 out of the box. In order to make it work with Raspberry Pi 4, I had to make a few modifications to the source code which I've included below:

diff .venv/tiktok-uploader/lib/python3.9/site-packages/tiktok_uploader/ src/tiktok_uploader/
diff .venv/tiktok-uploader/lib/python3.9/site-packages/tiktok_uploader/browsers.
py src/tiktok_uploader/browsers.py
177c177
<     'chrome': lambda : ChromeService('/usr/bin/chromedriver'),
---
>     'chrome': lambda : ChromeService(ChromeDriverManager().install()),
Only in .venv/tiktok-uploader/lib/python3.9/site-packages/tiktok_uploader/: __py                                                                                                                                                             cache__

I hope this will be useful for other Raspberry Pi users who would like to use your product. However, I also want to note that in my experience, there is a potential issue with the Raspberry Pi freezing while attempting to upload the video. This has happened to me a few times while using your product on my Raspberry Pi. I'm not sure if this is related to the modifications I made or if it's a separate issue, but I wanted to bring it to your attention nonetheless.

Please let me know if you have any questions or if there's anything else I can do to help. Thank you for your time and consideration.

I have to keep investigating and maybe go for a more lightweight solution

"video" word before description

image

There is the word "video" in front of my description which is added each time I upload a video.
However, it does not add it during my tests.
For example if my description is "tata" then the upload will be done correctly but when I go to Tiktok in the description of my video it will be indicated: "videotata"

no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='file']"}

Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='file']"}
(Session info: chrome=117.0.5938.92); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
GetHandleVerifier [0x0063CEB3+45171]
(No symbol) [0x005C9101]
(No symbol) [0x004BBE1D]
(No symbol) [0x004EED40]
(No symbol) [0x004EF20B]
(No symbol) [0x0051F692]
(No symbol) [0x0050B094]
(No symbol) [0x0051DCFA]
(No symbol) [0x0050AE46]
(No symbol) [0x004E675E]
(No symbol) [0x004E78FD]
GetHandleVerifier [0x008F54B9+2897529]
GetHandleVerifier [0x0093DC6B+3194411]
GetHandleVerifier [0x00937A41+3169281]
GetHandleVerifier [0x006C6130+606960]
(No symbol) [0x005D2E7C]
(No symbol) [0x005CF008]
(No symbol) [0x005CF12F]
(No symbol) [0x005C1827]
BaseThreadInitThunk [0x76A4FCC9+25]
RtlGetAppContainerNamedObjectPath [0x77667B1E+286]
RtlGetAppContainerNamedObjectPath [0x77667AEE+238]

Error while uploading Video

While trying to upload a video, I get this error. I am looking forward to your response

Traceback (most recent call last):
  File "/Users/leo/Desktop/projects/python_tiktok/upload.py", line 19, in <module>
    upload_video(video_file, description='Test', cookies_list="cookies.txt")
  File "/Users/leo/Library/Python/3.9/lib/python/site-packages/tiktok_uploader/upload.py", line 48, in upload_video
    return upload_videos(
  File "/Users/leo/Library/Python/3.9/lib/python/site-packages/tiktok_uploader/upload.py", line 86, in upload_videos
    videos = _convert_videos_dict(videos)
  File "/Users/leo/Library/Python/3.9/lib/python/site-packages/tiktok_uploader/upload.py", line 431, in _convert_videos_dict
    raise RuntimeError("Invalid path: " + path)
RuntimeError: Invalid path: /Users/leo/Desktop/projects/video.mp4

cannot login to tiktok account

I pass in the cookies and valid video file and the code will pull up a chrome window, but then get stuck on the login page, eventually leading to an error. I have tried multiple different tiktok accounts to test if that was the problem, but no luck. When the chrome page loads up tiktok, I think it gets stuck on the human verification task that tiktok prompts users with to make sure they are human. It only pops up for a blink, but I can't think of any other reason this would be happening.

Schedule tiktok Uploads

Good afternoon,
I would like to know if you could implement a feature that allows you to upload videos to tiktok using the scheduler that tiktok offers when you use business accounts.
The idea I have in mind is to run the script once a week and have the script schedule the upload of all videos to tiktok.
Is this possible?

Receive tiktok_uploader.auth.InsufficientAuth on every try to upload

Insufficient authentication:

    > TikTok uses cookies to keep track of the user's authentication or session.

    Either:
        - Use a cookies file passed as the `cookies` argument
            - easily obtained using https://github.com/kairi003/Get-cookies.txt-LOCALLY
        - Use a cookies list passed as the `cookies_list` argument
            - can be obtained from your browser's developer tools under storage -> cookies
            - only the `sessionid` cookie is required

Already tried different combinations of cookies, checked source code, but have no idea what I am doing wrong. Same results for CLI and for .py. Also tried clean venv, same result. Any suggestions?

Video upload failed

Hi there, I'm having some trouble with using the cookies.txt obtained from a Chrome extension. It doesn't seem to be working as when I run the Python script and visit tiktok.com, it says my account is not logged in. However, when I manually visit the site, it shows that I am already logged in. Here are the log prints:
"Uploading None
expected str, bytes or os.PathLike object, not NoneType
Uploading None
expected str, bytes or os.PathLike object, not NoneType." Can anyone help me out? Thanks in advance!

Emojis are not encoded correctly

If you run the program with the following parameters:
tiktok-uploader -v video.mp4 -d "Description with an emoji 👋" -c cookies.txt.

The emoji will be miscoded and displayed as strange characters.

Schedule not working

When I try to upload one video using the datetime for schedule it always fails with the following message:

Failed to set schedule: Something went wrong with the time picker, expected 18:00 but got 17:00
[17:11:30] Something went wrong with the time picker, expected 18:00 but got 17:00
[17:11:30] Failed to set schedule: Something went wrong with the time picker, expected 18:00 but got 17:00

My code is very simple:

 import datetime
from tiktok_uploader.upload import upload_video

schedule = datetime.datetime(2023, 9, 26, 18, 0)
upload_video(filename="../result/part_1_with_text.mp4",description="Just a test" ,cookies="./static/cookies.txt",
             schedule=schedule) 

Any thoughts?

There is no such driver by url

When I start the script, I get the following error: There is no such driver at the URL https://chromedriver.storage.googleapis.com/117.0.5938/chromedriver_mac64.zip.
Can I simply change the required string to a newer version of Chrome? If so, where should I do this?

Thank you for any help!

Did they change the user interface?

When I run the script I get:

Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='file']"}

Are the selectors in the default config still vaild?

[selectors.upload]
iframe = "//iframe"
upload_video = "//input[@type='file']"
upload_in_progress = "//*[.='Cancel']"
upload_confirmation = "//video"
process_confirmation = "//img[@Draggable='false']"
description = "//div[@contenteditable='true']"

tiktok_uploader cannot import

Trying the following imports:
from tiktok_uploader.upload import upload_videos
from tiktok_uploader.auth import AuthBackend
Fails to import. I am using PyCharm and have not run into this issue before, usually it just gives the option to install packages but this does not show up.

Error during upload

console spammed with Failed to resolve address for stun.l.google.com., errorcode: -105
then Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='file']"}

Code dont work

Bug happening at line 269 of upload.py:

# NOTE (IMPORTANT): implicit wait as video should already be uploaded if not failed
# An exception throw here means the video failed to upload an a retry is needed
WebDriverWait(driver, config['implicit_wait']).until(upload_confirmation)

I managed to fix it but it wasnt that simple. Code simply dont work, i dont know why it got stars lol

the video wont be uploaded

so everything seems to be working perfectly the headless browser does everything right, the problem is after the video is finished uploading (reaches 100%) it closes the browser and the console says the video failed to upload. maybe the browser does not click on the publish button before closing ? some help here pls
by the way there is no problem with the vid itself cause i did uploaded manually later on

Error while uploading video

on 26/8 friday is still ok can upload videos
but today 27/8 error when uploading

[14:34:29] ←[92mAuthenticating browser with cookies←[0m
[14:34:29] Create a chrome browser instance in headless mode

DevTools listening on ws://127.0.0.1:57538/devtools/browser/782c7b28-6f06-4dca-88de-f15934c5999e
[14:34:44] Authenticating browser with cookies
[14:35:04] Posting video0007.mp4
with description: this is my escaped from the worl
[14:35:04] Navigating to upload page
[14:35:08] Uploading video file
Message:
Stacktrace:
GetHandleVerifier [0x00E737C3+48947]
(No symbol) [0x00E08551]
(No symbol) [0x00D0C92D]
(No symbol) [0x00D39E38]
(No symbol) [0x00D39EFB]
(No symbol) [0x00D68EF2]
(No symbol) [0x00D550D4]
(No symbol) [0x00D675DA]
(No symbol) [0x00D54E86]
(No symbol) [0x00D316C7]
(No symbol) [0x00D3284D]
GetHandleVerifier [0x010BFDF9+2458985]
GetHandleVerifier [0x0110744F+2751423]
GetHandleVerifier [0x01101361+2726609]
GetHandleVerifier [0x00EF0680+560624]
(No symbol) [0x00E1238C]
(No symbol) [0x00E0E268]
(No symbol) [0x00E0E392]
(No symbol) [0x00E010B7]
BaseThreadInitThunk [0x760000C9+25]
RtlGetAppContainerNamedObjectPath [0x77587B1E+286]
RtlGetAppContainerNamedObjectPath [0x77587AEE+238]

Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='file']"}
(Session info: chrome=116.0.5845.111); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
GetHandleVerifier [0x00E737C3+48947]
(No symbol) [0x00E08551]
(No symbol) [0x00D0C92D]
(No symbol) [0x00D39E38]
(No symbol) [0x00D39EFB]
(No symbol) [0x00D68EF2]
(No symbol) [0x00D550D4]
(No symbol) [0x00D675DA]
(No symbol) [0x00D54E86]
(No symbol) [0x00D316C7]
(No symbol) [0x00D3284D]
GetHandleVerifier [0x010BFDF9+2458985]
GetHandleVerifier [0x0110744F+2751423]
GetHandleVerifier [0x01101361+2726609]
GetHandleVerifier [0x00EF0680+560624]
(No symbol) [0x00E1238C]
(No symbol) [0x00E0E268]
(No symbol) [0x00E0E392]
(No symbol) [0x00E010B7]
BaseThreadInitThunk [0x760000C9+25]
RtlGetAppContainerNamedObjectPath [0x77587B1E+286]
RtlGetAppContainerNamedObjectPath [0x77587AEE+238]

Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='file']"}
(Session info: chrome=116.0.5845.111); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
GetHandleVerifier [0x00E737C3+48947]
(No symbol) [0x00E08551]
(No symbol) [0x00D0C92D]
(No symbol) [0x00D39E38]
(No symbol) [0x00D39EFB]
(No symbol) [0x00D68EF2]
(No symbol) [0x00D550D4]
(No symbol) [0x00D675DA]
(No symbol) [0x00D54E86]
(No symbol) [0x00D316C7]
(No symbol) [0x00D3284D]
GetHandleVerifier [0x010BFDF9+2458985]
GetHandleVerifier [0x0110744F+2751423]
GetHandleVerifier [0x01101361+2726609]
GetHandleVerifier [0x00EF0680+560624]
(No symbol) [0x00E1238C]
(No symbol) [0x00E0E268]
(No symbol) [0x00E0E392]
(No symbol) [0x00E010B7]
BaseThreadInitThunk [0x760000C9+25]
RtlGetAppContainerNamedObjectPath [0x77587B1E+286]
RtlGetAppContainerNamedObjectPath [0x77587AEE+238]

[14:35:45] Failed to upload E:\TikTok\tiktok-uploader4\video0007.mp4
[14:35:45]
A video failed to upload


Error while uploading video

please check kaise how to solve...many many thanks

Stuck when trying to upload a video

Hey!!! Trying to upload a single video. Everything works fine (authenticate and video upload) but then it gets stuck in the Upload screen. I wrote an example description but instead there is the file name. Then it just freeze there.
Error I get after a few seconds of waiting: Message: no such element: Unable to locate element {"method":"xpath","selector":"//input[@type='file']"}

I guess this is the selector for the video upload but the video is already upload correctly. It freeze in the description,privacy options...
My tiktok is in Spanish so it might be a problem with selectors?

Add hastag + position de la miniature

Hello, I love your library it works perfectly and meets my needs! I would like to know if you could add an option to manage Hashtags. Because currently it doesn't work if I insert #test at the end of the description.

Also, I don't know if it's possible to change the thumbnail by moving the slider to X sec of the video?

Thank you so much !

Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='file']"}

Hello. Im trying to run the code but it stops at the content creator upload page. I think its unable to locate the upload button? Any help would be appreciated, thanks in advance.

[19:35:58] Uploading video file
[13488:13104:0919/193558.511:ERROR:socket_manager.cc(141)] Failed to resolve address for stun.l.google.com., errorcode: -105
[13488:13104:0919/193603.036:ERROR:socket_manager.cc(141)] Failed to resolve address for stun.l.google.com., errorcode: -105
[13488:13104:0919/193603.913:ERROR:socket_manager.cc(141)] Failed to resolve address for stun.l.google.com., errorcode: -105
Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='file']"}
  (Session info: chrome=116.0.5845.188); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
        GetHandleVerifier [0x004537C3+48947]
        (No symbol) [0x003E8551]
        (No symbol) [0x002EC92D]
        (No symbol) [0x00319E38]
        (No symbol) [0x00319EFB]
        (No symbol) [0x00348EF2]
        (No symbol) [0x003350D4]
        (No symbol) [0x003475DA]
        (No symbol) [0x00334E86]
        (No symbol) [0x003116C7]
        (No symbol) [0x0031284D]
        GetHandleVerifier [0x0069FDF9+2458985]
        GetHandleVerifier [0x006E744F+2751423]
        GetHandleVerifier [0x006E1361+2726609]
        GetHandleVerifier [0x004D0680+560624]
        (No symbol) [0x003F238C]
        (No symbol) [0x003EE268]
        (No symbol) [0x003EE392]
        (No symbol) [0x003E10B7]
        BaseThreadInitThunk [0x7723FCC9+25]
        RtlGetAppContainerNamedObjectPath [0x77387B1E+286]
        RtlGetAppContainerNamedObjectPath [0x77387AEE+238]

Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='file']"}
  (Session info: chrome=116.0.5845.188); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
        GetHandleVerifier [0x004537C3+48947]
        (No symbol) [0x003E8551]
        (No symbol) [0x002EC92D]
        (No symbol) [0x00319E38]
        (No symbol) [0x00319EFB]
        (No symbol) [0x00348EF2]
        (No symbol) [0x003350D4]
        (No symbol) [0x003475DA]
        (No symbol) [0x00334E86]
        (No symbol) [0x003116C7]
        (No symbol) [0x0031284D]
        GetHandleVerifier [0x0069FDF9+2458985]
        GetHandleVerifier [0x006E744F+2751423]
        GetHandleVerifier [0x006E1361+2726609]
        GetHandleVerifier [0x004D0680+560624]
        (No symbol) [0x003F238C]
        (No symbol) [0x003EE268]
        (No symbol) [0x003EE392]
        (No symbol) [0x003E10B7]
        BaseThreadInitThunk [0x7723FCC9+25]
        RtlGetAppContainerNamedObjectPath [0x77387B1E+286]
        RtlGetAppContainerNamedObjectPath [0x77387AEE+238]

Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='file']"}
  (Session info: chrome=116.0.5845.188); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
        GetHandleVerifier [0x004537C3+48947]
        (No symbol) [0x003E8551]
        (No symbol) [0x002EC92D]
        (No symbol) [0x00319E38]
        (No symbol) [0x00319EFB]
        (No symbol) [0x00348EF2]
        (No symbol) [0x003350D4]
        (No symbol) [0x003475DA]
        (No symbol) [0x00334E86]
        (No symbol) [0x003116C7]
        (No symbol) [0x0031284D]
        GetHandleVerifier [0x0069FDF9+2458985]
        GetHandleVerifier [0x006E744F+2751423]
        GetHandleVerifier [0x006E1361+2726609]
        GetHandleVerifier [0x004D0680+560624]
        (No symbol) [0x003F238C]
        (No symbol) [0x003EE268]
        (No symbol) [0x003EE392]
        (No symbol) [0x003E10B7]
        BaseThreadInitThunk [0x7723FCC9+25]
        RtlGetAppContainerNamedObjectPath [0x77387B1E+286]
        RtlGetAppContainerNamedObjectPath [0x77387AEE+238]

[19:36:10] Failed to upload C:\Users\Nick\Desktop\tiktok-uploader-main\video.mp4
[19:36:10]
    A video failed to upload

Questions

Hello, I would have few questions. Does it still working? Can we add musics from Tiktok? Thanks for answering

eror

Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Users\Danil\AppData\Local\Programs\Python\Python311\Scripts\tiktok-uploader.exe\__main__.py", line 7, in <module> File "C:\Users\Danil\tiktok-uploader\src\tiktok_uploader\cli.py", line 20, in main result = upload_video( ^^^^^^^^^^^^^ File "C:\Users\Danil\tiktok-uploader\src\tiktok_uploader\upload.py", line 40, in upload_video auth = AuthBackend(username=username, password=password, cookies=cookies) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Danil\tiktok-uploader\src\tiktok_uploader\auth.py", line 39, in __init__ raise InsufficientAuth() tiktok_uploader.auth.InsufficientAuth
how to fix it?

Hash tag and mention are plain text, not hyperlink, not clickable.

Hi,

Thank you for the your good project.

I see your demo with hashtag on c_span channel and it is working. I can click on hashtag as a link. But with my video, tag just is a text, and mention is @ sign only.

upload_video(filename='2.mp4', description='#fyp @IceSpicee', cookies=....)

it will be text #fyp@ on video and not clickable.

I run the code in headless mode chrome on Ubuntu server.

Did I do something wrong ?

Issue with Amazon Linux Systems

I dont know much but here is the error message

[06:53:43] Authenticating browser with cookies
[06:53:43] Create a chrome browser instance in headless mode
Traceback (most recent call last):
File "/home/ec2-user/.local/bin/tiktok-uploader", line 8, in
sys.exit(main())
File "/home/ec2-user/.local/lib/python3.9/site-packages/tiktok_uploader/cli.py", line 20, in main
result = upload_video(
File "/home/ec2-user/.local/lib/python3.9/site-packages/tiktok_uploader/upload.py", line 48, in upload_video
return upload_videos(
File "/home/ec2-user/.local/lib/python3.9/site-packages/tiktok_uploader/upload.py", line 94, in upload_videos
driver = get_browser(name=browser, headless=headless, *args, **kwargs)
File "/home/ec2-user/.local/lib/python3.9/site-packages/tiktok_uploader/browsers.py", line 40, in get_browser
driver = driver_to_use(service=service, options=options)
File "/home/ec2-user/.local/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 49, in init
super().init(
File "/home/ec2-user/.local/lib/python3.9/site-packages/selenium/webdriver/chromium/webdriver.py", line 51, in init
self.service.start()
File "/home/ec2-user/.local/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 97, in start
self.assert_process_still_running()
File "/home/ec2-user/.local/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 110, in assert_process_still_running
raise WebDriverException(f"Service {self._path} unexpectedly exited. Status code was: {return_code}")
selenium.common.exceptions.WebDriverException: Message: Service /home/ec2-user/.wdm/drivers/chromedriver/linux64/114.0.5735.90/chromedriver unexpectedly exited. Status code was: 127

Doesn't work if the language is not English

I spent a long time trying to figure out what the problem was, I had to look into the selectors to figure out what was wrong. Understanding the problem, I changed the language to English, updated the cookies and everything worked. I think we should at least make a note that English is required

Issue with: driver by url

Hey!! I have been having troubles to upload videos. The process get stuck when creating browser instance:
File "C:\Users\traso\Desktop\Tiktok\venv\Lib\site-packages\webdriver_manager\core\http.py", line 16, in validate_response raise ValueError(f"There is no such driver by url {resp.url}") ValueError: There is no such driver by url https://chromedriver.storage.googleapis.com/LATEST_RELEASE_115.0.5790
If you click the link where it is supposed to be the driver, it's not working, so I guess that's the problem. I don't know how I'm supposed to fix this. Should we replace the url from the driver?
Thanks in advance!!!
@wkaisertexas

Accept cookies on the way of "Post" button

[16:58:32] Failed to upload C:\Users\Administrator\Desktop\Upload\tiktok-uploader-main\TIFU by showing my mom a drawing of my sleep paralysis visitor shorts.mp4 [16:58:32] Message: element click intercepted: Element <iframe src="https://www.tiktok.com/creator#/upload?scene=creator_center" data-tt="Upload_index_iframe" style="height: 1205px; border-style: none; width: 100%; margin-bottom: -7px; z-index: 2; position: relative;" cd_frame_id_="d75316a20669e2b46fb655759bbebc4b"></iframe> is not clickable at point (667, 885). Other element would receive the click: <tiktok-cookie-banner locale="en" user-config-ele-id="tiktok-cookie-banner-config" disabled="false"></tiktok-cookie-banner> (Session info: chrome=117.0.5938.89):

Video scheduling

Heya - I started adding video scheduling to this - I was wondering, do you want other people to raise PRs against your code or do you prefer solo contribution ?

eror

i trying to use this but getting error

Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\Danil\AppData\Local\Programs\Python\Python311\Scripts\tiktok-uploader.exe_main
.py", line 7, in
File "C:\Users\Danil\tiktok-uploader\src\tiktok_uploader\cli.py", line 20, in main
result = upload_video(
^^^^^^^^^^^^^
File "C:\Users\Danil\tiktok-uploader\src\tiktok_uploader\upload.py", line 41, in upload_video
auth = AuthBackend(username=username, password=password, cookies=cookies)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Danil\tiktok-uploader\src\tiktok_uploader\auth.py", line 39, in init
raise InsufficientAuth()
tiktok_uploader.auth.InsufficientAuth:
Insufficient authentication:

> TikTok uses cookies to keep track of the user's authentication or session.

Either:
    - Use a cookies file passed as the `cookies` argument
        - easily obtained using https://github.com/kairi003/Get-cookies.txt-LOCALLY
    - Use a cookies list passed as the `cookies_list` argument
        - can be obtained from your browser's developer tools under storage -> cookies
        - only the `sessionid` cookie is required

but i fill txt file
(like this:
xxxxxxxxxxxxx
xxxxxxxxxxxxx)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.