wkaisertexas / tiktok-uploader

Automatically ⬆️ upload TikTok videos
https://pypi.org/project/tiktok-uploader/
360 stars 84 forks source link

Receive tiktok_uploader.auth.InsufficientAuth on every try to upload #47

Closed jujutsu764e closed 1 year ago

jujutsu764e commented 1 year ago
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?

wkaisertexas commented 1 year ago

Use either "cookies" for a file-based authentication or "cookies_list" for a dictionary-based authentication.

These are keyword arguments and must be specified as such otherwise this will not work.

Sorry for the confusion. If you have any more trouble, please paste the script you are using for greater context.

jujutsu764e commented 1 year ago

I did! I have tried both ways, with no success. I used exactly the same code, which provided in examples:

from tiktok_uploader.upload import upload_video

video_path = ".../final_video_1695124971.mp4"
cookies_path = ".../tiktok_cookies.json"
description = "Tech"
if __name__ == "__main__":
    upload_video(video_path,
                 description=description,
                 cookies=cookies_path,
                 headless=True)
cookies_list = [
    {
        "name": "sessionid",
        "value": "...",
        "domain": "www.tiktok.com",
        "path": "/",
        "expirationDate": 1710856080.556016
    }
]
jujutsu764e commented 1 year ago

After set "domain" to ".tiktok.com" and set cookies_list instead of cookies, seems problem has gone. But: Exception: No such driver version 116.0.5845.187 for mac-arm64. Anyway, it's another problem