zinkq / TikTok

Logging in to TikTok and scraping data(soon!)
19 stars 6 forks source link

maximum number of attempts reached. try again later #1

Open longnguyenQB opened 1 year ago

longnguyenQB commented 1 year ago

maximum number of attempts reached. try again later! Looks like tiktok has detected selenium!

zinkq commented 1 year ago

As I have written in the youtube video comments - that code is not supposed to cope with all TikTok anti-bot security systems. It only allows you just to use selenium on the TikTok website - because as y'all could notice, the default selenium scripts with any additional libraries or options simply don't work, you can't even send keys or click any button using selenium. And that's what I was coping with for a really long time and I couldn't find any solution, so I did post it, though.

Anyways, the code works still for me. It seems like you guys are missin' something. The uc_chromedriver and selenium stealth are strictly needed there, there's no other way to not get that error. Also, the waiting sequences between sending keys to the element on the website are needed. TikTok detects that you have inputted all the data within less than a few seconds from launching the web driver - it just simply qualifies you as a bot.

Possible solutions to your problem; a) other selenium stealth options that you should provide in your code b) additional proxies (that's probably the reason why you are getting that error while sending too many requests in a short time) c) longer, shorter or more random little breaks between sending keys to elements on the website.

longnguyenQB commented 1 year ago

i tried using undetected_chrome and text input speed, timeout but still can't. Looks like selenium can't pass tiktok. If you have other methods, please share. Thank you very much!

longnguyenQB commented 1 year ago

i tried using undetected_chrome and text input speed, timeout but still can't. Looks like selenium can't pass tiktok. If you have other methods, please share. Thank you very much!

Vào Th 7, 25 thg 3, 2023 vào lúc 01:36 zinkq @.***> đã viết:

As I have written in the youtube video comments - that code is not supposed to cope with all TikTok anti-bot security systems. It only allows you just to use selenium on the TikTok website - because as y'all could notice, the default selenium scripts with any additional libraries or options simply don't work, you can't even send keys or click any button using selenium. And that's what I was coping with for a really long time and I couldn't find any solution, so I did post it, though.

Anyways, the code works still for me. It seems like you guys are missin' something. The uc_chromedriver and selenium stealth are strictly needed there, there's no other way to not get that error. Also, the waiting sequences between sending keys to the element on the website are needed. TikTok detects that you have inputted all the data within less than a few seconds from launching the web driver - it just simply qualifies you as a bot.

Possible solutions to your problem; a) other selenium stealth options that you should provide in your code b) additional proxies (that's probably the reason why you are getting that error while sending too many requests in a short time) c) longer, shorter or more random little breaks between sending keys to elements on the website.

— Reply to this email directly, view it on GitHub https://github.com/zinkq/TikTok/issues/1#issuecomment-1483249795, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASLLAMDYF22HLGNDBBLXLNDW5XSSLANCNFSM6AAAAAAWGACVKM . You are receiving this because you authored the thread.Message ID: @.***>

zinkq commented 1 year ago

Are you using the same code as me? There is no way that it is not working for you, if you are using both selenium-stealth and undetected-chromedriver, as you can see on all tests that are available on the internet - the selenium stealth solves all of your problems. For me, everything is still working fine, though. So, if you are using your own code, then post it and we will see. Well, we can't use the same code with different result.

longnguyenQB commented 1 year ago

I used undetected_chrome and couldn't get past tiktok. Here is my code: https://github.com/longnguyenQB/ToolSelenium you should run the file tiktok.py Also I have some code for facebook and zalo, they all work very well, if you are interested you can check it out ^^

Vào Th 2, 27 thg 3, 2023 vào lúc 02:17 zinkq @.***> đã viết:

Are you using the same code as me? There is no way that it is not working for you, if you are using both selenium-stealth and undetected-chromedriver, as you can see on all tests that are available on the internet - the selenium stealth solves all of your problems. So, if you are using your own code, then post it and we will see. Well, we can't use the same code with different result.

— Reply to this email directly, view it on GitHub https://github.com/zinkq/TikTok/issues/1#issuecomment-1484195978, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASLLAMCA4LXC6SZWGQ3B6Z3W6CP4XANCNFSM6AAAAAAWGACVKM . You are receiving this because you authored the thread.Message ID: @.***>

zinkq commented 1 year ago

Firstly, install selenium-stealth

pip install selenium-stealth

Then implement this part of the code to your TikTokController.py file - it should fix your problem.

from selenium_stealth import stealth
import undetected_chromedriver as uc

driver = uc.Chrome(use_subprocess=True, headless=False)

stealth(driver,
        languages=["en-US", "en"],
        vendor="Google Inc.",
        platform="Win32",
        webgl_vendor="Intel Inc.",
        renderer="Intel Iris OpenGL Engine",
        fix_hairline=True,
        )
longnguyenQB commented 1 year ago

Thank you for enthusiastically replying to me. But this still doesn't work. I have a question: WebDriverWait, selenium.webdriver.common.by, selenium.webdriver.common.keys,... are these still used by selenium? Is that why tiktok can recognize bots? Here's the code I've edited, which you can test in the ChromeController.py file: https://github.com/longnguyenQB/ToolSelenium

If possible, I would love to be able to see your code for tiktok login problem. Thanks a lot!

Message ID: @.***>

longnguyenQB commented 1 year ago

I ran the same code as yours here: https://github.com/zinkq/TikTok/blob/main/main.py but I still get the error "maximum number of attempts reached. try again later" ^^

Vào Th 3, 28 thg 3, 2023 vào lúc 11:12 Long Nguyễn < @.***> đã viết:

Thank you for enthusiastically replying to me. But this still doesn't work. I have a question: WebDriverWait, selenium.webdriver.common.by, selenium.webdriver.common.keys,... are these still used by selenium? Is that why tiktok can recognize bots? Here's the code I've edited, which you can test in the ChromeController.py file: https://github.com/longnguyenQB/ToolSelenium

If possible, I would love to be able to see your code for tiktok login problem. Thanks a lot!

Message ID: @.***>

zinkq commented 1 year ago

So, I can't help you anymore. The only thing that I can suggest to you is to change your IP in some way, though. Maybe try using VPN or proxies. Good luck, my friend.

Zehyper commented 3 weeks ago

Hey, Zinkq wondering how I can contact you regarding your TikTok bot, willing to pay for it!