wanghaisheng / tiktoka-studio-uploader

Schedule and Publish contents erverywhere.Bulk auto video upload and Scheduling & Publishing Effortless for You & Your Entire Team. batch headless upload all major social networks using this ultimate social media scheduler. Fret less, save time, and generate more leads!
https://www.tiktokastudio.com
MIT License
274 stars 52 forks source link

Why are my last tiktok videos private. And it cannot be modified to be public? #73

Closed kingmacth closed 9 months ago

kingmacth commented 9 months ago

Checklist

Question

Why are my last tiktok videos private. And it cannot be modified to be public?

wanghaisheng commented 9 months ago

try latest code

kingmacth commented 9 months ago

try latest code

I downloaded it yesterday, which is the latest code.

wanghaisheng commented 9 months ago

i just update it a few minutes ago.

kingmacth commented 9 months ago

I just tested the latest code and the uploaded video is still private and cannot be modified to public. My last code was `path = video_path title = video_title tags = mTags #["Funny", "Joke", "fyp"] users = users proxy = {'http': 'http://127.0.0.1:1081', 'https': 'http://127.0.0.1:1081'} url_server = 'us'

 print(f'start to upload video:{path} to tiktok')
 schedule_time = 0
 isupload = upload2TiktokSessionId(session_id, path, title, tags, users, url_server, schedule_time, proxy)`
wanghaisheng commented 9 months ago

update again

jbeairdy commented 9 months ago

I am having the same issue. From what I understand, upload2TiktokSessionId() uses the official TikTok API (v1) to post videos. Per the documentation for the API: "Note: All content posted by unaudited clients will be restricted to private viewing mode. Once you have successfully tested your integration, to lift the restrictions on content visibility, your API client must undergo an audit to verify compliance with our Terms of Service."

source page: https://developers.tiktok.com/doc/content-posting-api-get-started/

wanghaisheng commented 9 months ago

I noticed that, then this session id way is shutdown we use switch to selenium or playwright @jbeairdy

or finished my earlier work to get official api works https://github.com/wanghaisheng/tiktok-opensdk-web

kingmacth commented 9 months ago

I am having the same issue. From what I understand, upload2TiktokSessionId() uses the official TikTok API (v1) to post videos. Per the documentation for the API: "Note: All content posted by unaudited clients will be restricted to private viewing mode. Once you have successfully tested your integration, to lift the restrictions on content visibility, your API client must undergo an audit to verify compliance with our Terms of Service."

source page: https://developers.tiktok.com/doc/content-posting-api-get-started/

Thanks for the explanation! I've been trying for the past two days and can't find the reason. Now I know!

kingmacth commented 9 months ago

之前的工作以获得官方 api 作品

playwright

Looking forward to completing the playwright way of uploading! Thanks again!

kingmacth commented 9 months ago

I am having the same issue. From what I understand, upload2TiktokSessionId() uses the official TikTok API (v1) to post videos. Per the documentation for the API:我有同样的问题。据我了解,upload2TiktokSessionId() 使用官方 TikTok API (v1) 来发布视频。根据 API 文档: "Note: All content posted by unaudited clients will be restricted to private viewing mode. Once you have successfully tested your integration, to lift the restrictions on content visibility, your API client must undergo an audit to verify compliance with our Terms of Service." “注意:未经审核的客户发布的所有内容都将仅限于私人查看模式。成功测试集成后,为了解除对内容可见性的限制,您的 API 客户端必须接受审核,以验证是否符合我们的服务条款。”

source page: https://developers.tiktok.com/doc/content-posting-api-get-started/源码页面:https://developers.tiktok.com/doc/content-posting-api-get-started/

Do you know of any other projects that can be successfully uploaded to tiktok? I have tested many different projects in the past two days, but none of them can be uploaded successfully! ​

jbeairdy commented 9 months ago

@kingmacth I have been testing the TikTok playwright files in this repository over the past few days (tsup/tiktok/pl/TiktokUpload.py). It seems to me that TikTok simply locks down their website much tighter than youtube (the Youtube playwright files work perfectly!).

When attempting to load cookies at "tiktok.com/upload", the playwright browser is always redirected to the login page instead, which makes things particularly difficult. Username and password can be filled easily, and I even found an API that is able to solve the circle rotation captchas with high accuracy.

However, the website will give you a cooldown if you login too many times (even if all logins are successful and/or from different accounts!). Additionally, approximately 1 in 50 captchas is different from the regular circle captcha, which can break the login program.

TL;DR: If this is going to work in playwright, I believe the cookie loading at "tiktok.com/upload" needs to be fixed. Some method needs to be found to prevent redirection back to the login page. I have tried a few things, but still have no idea how to do this. Maybe it is possible with selenium -- I have not tried.

@wanghaisheng Thanks for all your work, this repository is awesome! Let me know what you think about my comments. I am also eager to make this work in playwright (or selenium).

kingmacth commented 9 months ago

@kingmacth I have been testing the TikTok playwright files in this repository over the past few days (tsup/tiktok/pl/TiktokUpload.py). It seems to me that TikTok simply locks down their website much tighter than youtube (the Youtube playwright files work perfectly!).

When attempting to load cookies at "tiktok.com/upload", the playwright browser is always redirected to the login page instead, which makes things particularly difficult. Username and password can be filled easily, and I even found an API that is able to solve the circle rotation captchas with high accuracy.

However, the website will give you a cooldown if you login too many times (even if all logins are successful and/or from different accounts!). Additionally, approximately 1 in 50 captchas is different from the regular circle captcha, which can break the login program.

TL;DR: If this is going to work in playwright, I believe the cookie loading at "tiktok.com/upload" needs to be fixed. Some method needs to be found to prevent redirection back to the login page. I have tried a few things, but still have no idea how to do this. Maybe it is possible with selenium -- I have not tried.

@wanghaisheng Thanks for all your work, this repository is awesome! Let me know what you think about my comments. I am also eager to make this work in playwright (or selenium).

proxy_server = "http://127.0.0.1:1081"
cookie = {"name": "sessionid", "value":sessionid, 'domain': '.tiktok.com', 'path': '/'}
async with async_playwright() as p:
    browser = await p.firefox.launch(headless=False, proxy={"server": proxy_server})
    context = await browser.new_context()
    await context.add_cookies([cookie])
    page = await context.new_page()
    await page.goto('https://www.tiktok.com/creator-center/upload', timeout=60000)

I also tried some methods! I can log in normally using the above code. And enter the upload page. The problem I'm having is that I can't get the video to upload. I found that the web page code output by page.context is different from the code displayed by the browser developer mode. Upload element cannot be captured correctly.

wanghaisheng commented 9 months ago

@jbeairdy as you guy can see, during May yo July I am trying 3 ways to support tiktok 1.old playwright way, but got stuck with login issue you mentioned, try to fix through crack tiktok rotating capcha, this is still in progress now.then I try to embed a anti browser like adspower in this small lib to prepare more human fingerprint to avoid login issue, there are 3 attempts too. link https://github.com/wanghaisheng/tiktoka-studio-uploader/tree/master/tsup/botright https://github.com/wanghaisheng/tiktoka-studio-uploader/tree/master/tsup/utils/stealth https://github.com/wanghaisheng/tiktoka-studio-uploader/blob/master/tsup/utils/webdriver/playwright_driver_async_undetected.py unfortunately I have not make anyone of this solid works

2.tiktok open api ,as you can see, tiktok offer android and ios sdk for their api but there is no support for web,so I grab docs and the methodology they use to generate api sdk from docs,it came to:

https://github.com/wanghaisheng/tiktok-opensdk-web

3.selenium way https://github.com/wanghaisheng/tiktoka-studio-uploader/tree/master/tsup/tiktok/selenium I have "stolen" the current selenium pack from https://github.com/wkaisertexas/tiktok-uploader.

need to test though

  1. for find a better proxy to hide your real ip , I want to make a proxy provider scoring tool

https://github.com/wanghaisheng/tiktoka-studio-uploader/blob/master/examples/botcheck.py

due to my work and energy all in the gui version, I will as soon as possible to continue the previous attempt

@kingmacth

The problem I'm having is that I can't get the video to upload. I found that the web page code output by page.context is different from the code displayed by the browser developer mode. Upload element cannot be captured correctly.

can you just share the selector and screen recording for debug that?

kingmacth commented 9 months ago

@jbeairdy as you guy can see, during May yo July I am trying 3 ways to support tiktok 1.old playwright way, but got stuck with login issue you mentioned, try to fix through crack tiktok rotating capcha, this is still in progress now.then I try to embed a anti browser like adspower in this small lib to prepare more human fingerprint to avoid login issue, there are 3 attempts too. link https://github.com/wanghaisheng/tiktoka-studio-uploader/tree/master/tsup/botright https://github.com/wanghaisheng/tiktoka-studio-uploader/tree/master/tsup/utils/stealth https://github.com/wanghaisheng/tiktoka-studio-uploader/blob/master/tsup/utils/webdriver/playwright_driver_async_undetected.py unfortunately I have not make anyone of this solid works

2.tiktok open api ,as you can see, tiktok offer android and ios sdk for their api but there is no support for web,so I grab docs and the methodology they use to generate api sdk from docs,it came to:

https://github.com/wanghaisheng/tiktok-opensdk-web

3.selenium way https://github.com/wanghaisheng/tiktoka-studio-uploader/tree/master/tsup/tiktok/selenium I have "stolen" the current selenium pack from https://github.com/wkaisertexas/tiktok-uploader.

need to test though

  1. for find a better proxy to hide your real ip , I want to make a proxy provider scoring tool

https://github.com/wanghaisheng/tiktoka-studio-uploader/blob/master/examples/botcheck.py

due to my work and energy all in the gui version, I will as soon as possible to continue the previous attempt

@kingmacth

The problem I'm having is that I can't get the video to upload. I found that the web page code output by page.context is different from the code displayed by the browser developer mode. Upload element cannot be captured correctly.

can you just share the selector and screen recording for debug that?

Do you need me to send you the screen recording of the debugging process? Which windows need to be opened?

wanghaisheng commented 9 months ago

anything you can share is fine

kingmacth commented 9 months ago

anything you can share is fine

https://drive.google.com/file/d/1qpTQsqMyJ-F1y-oL9npCOqxGMhfGrdKX/view?usp=sharing

This is my debugging process. You can directly enter the upload page through sessionid. But I tried many methods but couldn't upload the file.

wanghaisheng commented 9 months ago

i know what is your issue here try to run this code https://github.com/wanghaisheng/tiktoka-studio-uploader/blob/master/examples/saveCookie.py and learn playwright codegen ,you will get the selector correctly

wanghaisheng commented 9 months ago

@kingmacth @jbeairdy I have update the selenium version can you guys test it a little ,my network is horriable